fix(get-node-intersections): calculate overlapping area correctly #5382

This commit is contained in:
moklick
2025-07-09 10:04:38 +02:00
parent 79a9b0da9a
commit 025385ca4e
3 changed files with 17 additions and 9 deletions
+5 -1
View File
@@ -222,7 +222,11 @@ export function useReactFlow<NodeType extends Node = Node, EdgeType extends Edge
const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);
const partiallyVisible = partially && overlappingArea > 0;
return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height;
return (
partiallyVisible ||
overlappingArea >= currNodeRect.width * currNodeRect.height ||
overlappingArea >= nodeRect.width * nodeRect.height
);
}) as NodeType[];
},
isNodeIntersecting: (nodeOrRect, area, partially = true) => {