fix(onNodeDrag): show correct position closes #2246

This commit is contained in:
moklick
2022-07-11 16:13:33 +02:00
parent 8d530c192a
commit 044095bda1
7 changed files with 30 additions and 15 deletions
+1 -9
View File
@@ -99,16 +99,8 @@ const createStore = () =>
};
if (positionChanged) {
change.positionAbsolute = node.position;
change.positionAbsolute = node.positionAbsolute;
change.position = node.position;
if (node.parentNode) {
const parentNode = nodeInternals.get(node.parentNode);
change.position = {
x: change.position.x - (parentNode?.positionAbsolute?.x ?? 0),
y: change.position.y - (parentNode?.positionAbsolute?.y ?? 0),
};
}
}
return change;