fix(subflow-node-origin): use node origin in node position calculation

This commit is contained in:
Christopher Möller
2022-11-24 16:55:51 +01:00
parent 6bbc004315
commit 3685420ebf
7 changed files with 97 additions and 36 deletions
+2 -1
View File
@@ -114,6 +114,7 @@ function useDrag({
onSelectionDrag,
snapGrid,
snapToGrid,
nodeOrigin,
} = store.getState();
const pointerPos = getPointerPosition(event);
// skip events without movement
@@ -133,7 +134,7 @@ function useDrag({
nextPosition.y = snapGrid[1] * Math.round(nextPosition.y / snapGrid[1]);
}
const updatedPos = calcNextPosition(n, nextPosition, nodeInternals, nodeExtent);
const updatedPos = calcNextPosition(n, nextPosition, nodeInternals, nodeExtent, nodeOrigin);
n.position = updatedPos.position;
n.positionAbsolute = updatedPos.positionAbsolute;