File tree Expand file tree Collapse file tree
editor/pages/_development/editor-canvas Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from "react" ;
22import { Canvas } from "@code-editor/canvas" ;
33import ClientOnly from "components/client-only" ;
4+ import useMeasure from "react-use-measure" ;
45
56export 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 = { [ ] }
You can’t perform that action at this time.
0 commit comments