Merge pull request #4232 from adroitwhiz/develop

Wrap the stage canvas so that styles are not directly applied to it, fixing bounds calculations
This commit is contained in:
Paul Kaplan authored and GitHub committed 2019-01-03 11:44:05 -05:00
commit d05e8f0ea5
4 files changed
+17 -5

No files matched your search

+1
View File
@@ -4,6 +4,7 @@
# NPM
/node_modules
npm-*
/package-lock.json
# Testing
/.nyc_output
+1 -1
View File
@@ -9,9 +9,9 @@
*/
display: block;
/* Attach border radius directly to canvas to prevent needing overflow:hidden; */
border-radius: $space;
border: $stage-standard-border-width solid $ui-black-transparent;
overflow: hidden;
/* @todo: This is for overriding the value being set somewhere. Where is it being set? */
background-color: transparent;
+11 -4
View File
@@ -48,18 +48,25 @@ const StageComponent = props => {
}}
onDoubleClick={onDoubleClick}
>
<DOMElementRenderer
<Box
className={classNames(
styles.stage,
{[styles.stageOverlayContent]: isFullScreen}
)}
domElement={canvas}
style={{
height: stageDimensions.height,
width: stageDimensions.width
}}
{...boxProps}
/>
>
<DOMElementRenderer
domElement={canvas}
style={{
height: stageDimensions.height,
width: stageDimensions.width
}}
{...boxProps}
/>
</Box>
<Box className={styles.monitorWrapper}>
<MonitorList
draggable={useEditorDragStyle}
+4
View File
@@ -69,6 +69,10 @@ const getStageDimensions = (stageSize, isFullScreen) => {
stageDimensions.width = stageDimensions.scale * stageDimensions.widthDefault;
}
// Round off dimensions to prevent resampling/blurriness
stageDimensions.height = Math.round(stageDimensions.height);
stageDimensions.width = Math.round(stageDimensions.width);
return stageDimensions;
};