Skip to content

Commit b0a3281

Browse files
hard lock canvas not to overflow width
1 parent 7baa042 commit b0a3281

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

editor/components/canvas/interactive-canvas.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export function InteractiveCanvas({
3434
const InteractiveCanvasWrapper = styled.div`
3535
display: flex;
3636
flex-direction: column;
37+
overflow-y: auto;
38+
overflow-x: hidden;
3739
flex: 1;
3840
`;
3941

@@ -51,6 +53,7 @@ const ScalingAreaStaticRoot = styled.div`
5153
align-content: flex-start;
5254
align-self: stretch;
5355
flex: 1;
56+
max-height: 100vh; // TODO: make dynamic
5457
`;
5558

5659
function ScalableFrame({

editor/scaffolds/canvas/canvas.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ export function Canvas({
2020
return (
2121
<CanvasContainer id="canvas">
2222
<EditorAppbarFragments.Canvas />
23+
{/* <div
24+
style={{
25+
display: "flex",
26+
justifyContent: "center",
27+
flex: 1,
28+
}}
29+
> */}
2330
<InteractiveCanvas key={fileid + sceneid} defaultSize={originsize}>
2431
{preview ? (
2532
<VanillaRunner
@@ -37,6 +44,7 @@ export function Canvas({
3744
<EditorCanvasSkeleton />
3845
)}
3946
</InteractiveCanvas>
47+
{/* </div> */}
4048
</CanvasContainer>
4149
);
4250
}
@@ -64,5 +72,6 @@ const EditorCanvasSkeleton = () => {
6472
const CanvasContainer = styled.div`
6573
display: flex;
6674
flex-direction: column;
75+
max-width: calc((100vw - 200px) / 2); // TODO: make this dynamic
6776
height: 100%;
6877
`;

0 commit comments

Comments
 (0)