fix(core): use existing node for intersection check
This commit is contained in:
@@ -43,6 +43,7 @@ import {
|
|||||||
getSelectionChanges,
|
getSelectionChanges,
|
||||||
isDef,
|
isDef,
|
||||||
isEdge,
|
isEdge,
|
||||||
|
isGraphNode,
|
||||||
isNode,
|
isNode,
|
||||||
isRect,
|
isRect,
|
||||||
nodeToRect,
|
nodeToRect,
|
||||||
@@ -639,7 +640,7 @@ export function useActions(
|
|||||||
nodeOrRect: (Partial<Node> & { id: Node['id'] }) | Rect,
|
nodeOrRect: (Partial<Node> & { id: Node['id'] }) | Rect,
|
||||||
): [Rect | null, Node | null | undefined, boolean] => {
|
): [Rect | null, Node | null | undefined, boolean] => {
|
||||||
const isRectObj = isRect(nodeOrRect)
|
const isRectObj = isRect(nodeOrRect)
|
||||||
const node = isRectObj ? null : findNode(nodeOrRect.id)
|
const node = isRectObj ? null : isGraphNode(nodeOrRect as GraphNode) ? (nodeOrRect as GraphNode) : findNode(nodeOrRect.id)
|
||||||
|
|
||||||
if (!isRectObj && !node) {
|
if (!isRectObj && !node) {
|
||||||
return [null, null, isRectObj]
|
return [null, null, isRectObj]
|
||||||
|
|||||||
Reference in New Issue
Block a user