refactor(core): avoid passing reactive values to position changes (#1937)

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2025-08-31 13:59:37 +02:00
parent 490473d997
commit bd606b98a2
3 changed files with 23 additions and 24 deletions
+4 -4
View File
@@ -1,6 +1,5 @@
import { markRaw } from 'vue'
import type {
Actions,
Box,
Connection,
CoordinateExtent,
@@ -16,6 +15,7 @@ import type {
GraphNode,
MaybeElement,
Node,
NodeLookup,
Rect,
ViewportTransform,
XYPosition,
@@ -471,12 +471,12 @@ export function getXYZPos(parentPos: XYZPosition, computedPosition: XYZPosition)
}
}
export function isParentSelected(node: GraphNode, findNode: Actions['findNode']): boolean {
export function isParentSelected(node: GraphNode, nodeLookup: NodeLookup): boolean {
if (!node.parentNode) {
return false
}
const parent = findNode(node.parentNode)
const parent = nodeLookup.get(node.parentNode)
if (!parent) {
return false
}
@@ -485,7 +485,7 @@ export function isParentSelected(node: GraphNode, findNode: Actions['findNode'])
return true
}
return isParentSelected(parent, findNode)
return isParentSelected(parent, nodeLookup)
}
export function getMarkerId(marker: EdgeMarkerType | undefined, vueFlowId?: string) {