fix(subflows): use abs positions for internal calculations (#2189)
* refactor(dragging): only use absolute positions * refactor(drag): handle node extent * refactor(drag-handler): return latest data * refactor(use-drag): cleanup fixes #2181
This commit is contained in:
@@ -99,7 +99,16 @@ const createStore = () =>
|
||||
};
|
||||
|
||||
if (positionChanged) {
|
||||
change.positionAbsolute = node.position;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user