fix(drag): check if node position was manually changed since last drag
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user