fix: custom node example not fitting view

* fit view can't work (for the onLoad event) for elements assigned after the host has mounted (onMounted hook) as we can't calculate a rect of elements that don't exist at flow creation
* in this case just trigger fit view __after__ elements have been created/passed to the flow

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-06 08:54:35 +01:00
parent a8f7cc2389
commit 5437d48325
5 changed files with 144 additions and 156 deletions
+3 -3
View File
@@ -23,9 +23,9 @@ export default (store = useStore()): UseZoomPanHelper => {
bounds,
store.dimensions.width,
store.dimensions.height,
options.minZoom || store.minZoom,
options.maxZoom || store.maxZoom,
options.padding || DEFAULT_PADDING,
options.minZoom ?? store.minZoom,
options.maxZoom ?? store.maxZoom,
options.padding ?? DEFAULT_PADDING,
)
const transform = zoomIdentity.translate(x, y).scale(zoom)