Skip to content

Commit bf830d6

Browse files
fix build
1 parent 5294018 commit bf830d6

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • editor/pages/_development/editor-canvas

editor/pages/_development/editor-canvas/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import React from "react";
22
import { Canvas } from "@code-editor/canvas";
33
import ClientOnly from "components/client-only";
4+
import useMeasure from "react-use-measure";
45

56
export default function EditorCanvasDevPage() {
7+
const [canvasSizingRef, canvasBounds] = useMeasure();
8+
69
return (
710
<div
11+
ref={canvasSizingRef}
812
style={{
913
width: "100vw",
1014
height: "100vh",
@@ -15,14 +19,10 @@ export default function EditorCanvasDevPage() {
1519
filekey="unknown"
1620
pageid="1"
1721
viewbound={[
18-
0,
19-
0,
20-
window.innerWidth ||
21-
document.documentElement.clientWidth ||
22-
document.body.clientWidth,
23-
window.innerHeight ||
24-
document.documentElement.clientHeight ||
25-
document.body.clientHeight,
22+
canvasBounds.left,
23+
canvasBounds.top,
24+
canvasBounds.bottom,
25+
canvasBounds.right,
2626
]}
2727
selectedNodes={[]}
2828
nodes={[]}

0 commit comments

Comments
 (0)