You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ever since upgrading to v10, i've noticed that fitView no longer worked correctly. Turns out the culprit is sub flows.
When using sub flows it looks like all nodes with a parentNode are ignored in the bounding box calculation, essentially centering the view on parentNodes only. If I drop sub flow (v9 style), the centering works as expected. If all your sub nodes are positioned within the natural bounding box of all parentNodes, the problem is not apparent, but moving sub nodes outside of this will essentially cut them off.
See the Codesandbox where one of the nodes have parentNode set and are position on top of parent, and then becomes cut off when centering the view.
Describe the Bug
Ever since upgrading to v10, i've noticed that
fitView
no longer worked correctly. Turns out the culprit is sub flows.When using sub flows it looks like all nodes with a
parentNode
are ignored in the bounding box calculation, essentially centering the view onparentNode
s only. If I drop sub flow (v9 style), the centering works as expected. If all your sub nodes are positioned within the natural bounding box of all parentNodes, the problem is not apparent, but moving sub nodes outside of this will essentially cut them off.See the Codesandbox where one of the nodes have
parentNode
set and are position on top of parent, and then becomes cut off when centering the view.Your Example Website or App
https://codesandbox.io/s/sandpack-project-forked-s87wqe?file=/initial-elements.js
Steps to Reproduce the Bug or Issue
fitView
and notice how sub flow nodes are seemingly ignoredExpected behavior
Using sub flow should not mess up
fitView
(orgetRectOfNodes
)Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: