Skip to content

Commit e97a65b

Browse files
committed
fix(core): calculate overlapping area correctly (#1914)
* fix(core): calculate overlapping area correctly Signed-off-by: braks <[email protected]> * chore(changeset): add --------- Signed-off-by: braks <[email protected]>
1 parent ed18865 commit e97a65b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/afraid-lies-deny.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-flow/core": patch
3+
---
4+
5+
Calculate overlapping area in getNodeIntersections correctly.

packages/core/src/store/actions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,11 @@ export function useActions(state: State, nodeLookup: ComputedRef<NodeLookup>, ed
662662
const overlappingArea = getOverlappingArea(currNodeRect, nodeRect)
663663
const partiallyVisible = partially && overlappingArea > 0
664664

665-
if (partiallyVisible || overlappingArea >= Number(nodeRect.width) * Number(nodeRect.height)) {
665+
if (
666+
partiallyVisible ||
667+
overlappingArea >= currNodeRect.width * currNodeRect.height ||
668+
overlappingArea >= Number(nodeRect.width) * Number(nodeRect.height)
669+
) {
666670
intersections.push(n)
667671
}
668672
}

0 commit comments

Comments
 (0)