fix: zoom pan helper

This commit is contained in:
Braks
2021-10-20 22:39:54 +02:00
parent a895853b64
commit c3fb3cd10a
38 changed files with 214 additions and 277 deletions
+3 -13
View File
@@ -1,15 +1,5 @@
<script lang="ts" setup>
import { RevueFlowHooks } from '~/hooks/RevueFlowHooks'
import {
getEdgeCenter,
getBezierPath,
getMarkerEnd,
ArrowHeadType,
EdgeProps,
ElementId,
Position,
RevueFlowStore,
} from '~/index'
import { getEdgeCenter, getBezierPath, getMarkerEnd, ArrowHeadType, EdgeProps, ElementId, Position, Hooks, Store } from '~/index'
interface CustomEdgeProps<T = any> extends EdgeProps<T> {
id: ElementId
@@ -25,8 +15,8 @@ interface CustomEdgeProps<T = any> extends EdgeProps<T> {
}
const props = defineProps<CustomEdgeProps>()
const store = inject<RevueFlowStore>('store')!
const hooks = inject<RevueFlowHooks>('hooks')!
const store = inject(Store)!
const hooks = inject(Hooks)!
const onEdgeClick = (evt: Event, id: string) => {
const edge = store.edges.find((edge) => edge.id === id)
if (edge) {