From e97a65b6b56ee2168b329cd23ee0e9d9099af146 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 7 Aug 2025 15:32:08 +0200 Subject: [PATCH] fix(core): calculate overlapping area correctly (#1914) * fix(core): calculate overlapping area correctly Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .changeset/afraid-lies-deny.md | 5 +++++ packages/core/src/store/actions.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/afraid-lies-deny.md diff --git a/.changeset/afraid-lies-deny.md b/.changeset/afraid-lies-deny.md new file mode 100644 index 00000000..982e3bab --- /dev/null +++ b/.changeset/afraid-lies-deny.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Calculate overlapping area in getNodeIntersections correctly. diff --git a/packages/core/src/store/actions.ts b/packages/core/src/store/actions.ts index 83c5520e..5019c616 100644 --- a/packages/core/src/store/actions.ts +++ b/packages/core/src/store/actions.ts @@ -662,7 +662,11 @@ export function useActions(state: State, nodeLookup: ComputedRef, ed const overlappingArea = getOverlappingArea(currNodeRect, nodeRect) const partiallyVisible = partially && overlappingArea > 0 - if (partiallyVisible || overlappingArea >= Number(nodeRect.width) * Number(nodeRect.height)) { + if ( + partiallyVisible || + overlappingArea >= currNodeRect.width * currNodeRect.height || + overlappingArea >= Number(nodeRect.width) * Number(nodeRect.height) + ) { intersections.push(n) } }