refactor(core): keep connection line snapped to handle while hovering
This commit is contained in:
@@ -81,13 +81,15 @@ export function getClosestHandle(
|
|||||||
const validHandleResult = validator({ nodeId: handleNodeId, id: handleId, type: handleType })
|
const validHandleResult = validator({ nodeId: handleNodeId, id: handleId, type: handleType })
|
||||||
|
|
||||||
if (validHandleResult) {
|
if (validHandleResult) {
|
||||||
|
const handle = handles.find((h) => h.nodeId === handleNodeId && h.type === handleType && h.id === handleId)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
handle: {
|
handle: {
|
||||||
id: handleId,
|
id: handleId,
|
||||||
type: handleType,
|
type: handleType,
|
||||||
nodeId: handleNodeId,
|
nodeId: handleNodeId,
|
||||||
x: pos.x,
|
x: handle?.x || pos.x,
|
||||||
y: pos.y,
|
y: handle?.y || pos.y,
|
||||||
},
|
},
|
||||||
validHandleResult,
|
validHandleResult,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user