How to disable auto-resize in Canvas? #2439
Replies: 2 comments 2 replies
-
in the end its all just css, the canvas cannot resize if it's inside a fixed size div with rel or abs positioning. i don't think zooming the canvas is a good idea though.
that also isn't optimal because browsers dislike it. you can do this: https://codesandbox.io/s/view-tracking-bp6tmc |
Beta Was this translation helpful? Give feedback.
-
btw the https://reactflow.dev/ main site also uses fiber, curiously, so they must have figured it out. maybe it's easier to ask them. or perhaps that example is even open source somewhere? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using react-three-fiber in reactflow node which use d3zoom to scale nodes. If I zoom to 2x, the canvas is scaled to 4x.
code sandbox, change default zoom in App.js L35 to 1 or 2 and refresh sandbox page to see canvas size:

real app:


1x:
2x:
createRoot: I need to render multiple 3d scene node in one flow, so this isn't suitable
Beta Was this translation helpful? Give feedback.
All reactions