fix: edge anchor

This commit is contained in:
Braks
2021-10-20 22:39:54 +02:00
parent 8c54daedc0
commit 7ecbcba7eb
9 changed files with 54 additions and 68 deletions
+8 -14
View File
@@ -37,21 +37,15 @@ const hooks = inject(Hooks)!
const zoomPaneEl = templateRef<HTMLDivElement>('zoom-pane', null)
const { transform } = useZoom(zoomPaneEl, props)
const { width, height } = useElementBounding(zoomPaneEl)
watch(width, (val) => (store.dimensions.width = val), { flush: 'post' })
watch(height, (val) => (store.dimensions.height = val), { flush: 'post' })
watch(transform, (val) => (store.transform = val), { flush: 'post' })
watch(width, (val) => (store.dimensions.width = val))
watch(height, (val) => (store.dimensions.height = val))
watch(transform, (val) => (store.transform = val))
const { zoomIn, zoomOut, zoomTo, transform: setTransform, fitView } = useZoomPanHelper()
hooks.load.trigger({
fitView: (params = { padding: 0.1 }) => fitView(params),
zoomIn,
zoomOut,
zoomTo,
setTransform,
project: onLoadProject(store),
getElements: onLoadGetElements(store),
toObject: onLoadToObject(store),
})
store.transform = transform.value
store.dimensions = {
width: width.value,
height: height.value,
}
</script>
<template>
<div ref="zoom-pane" class="revue-flow__renderer revue-flow__zoompane">