fix(drag): check if node position was manually changed since last drag

This commit is contained in:
bcakmakoglu
2022-05-27 23:36:01 +02:00
committed by Braks
parent e483da2443
commit 128c1a4a84
@@ -98,6 +98,13 @@ function useDrag(params: UseDragParams) {
}
})
.on('drag', (event: UseDragEvent) => {
parentPos = getParentNodePosition(node && node.parentNode ? getNode(node!.parentNode!) : undefined)
if (node && (lastPos.x !== node.position.x || lastPos.y !== node.position.y)) {
lastPos.x = node.position.x
lastPos.y = node.position.y
}
const mousePos = getMousePosition(event)
// skip events without movement