added correct expandParent offset of children

This commit is contained in:
peterkogo
2024-04-15 17:23:14 +02:00
parent ccf6578824
commit 87086e9997
5 changed files with 34 additions and 8 deletions
@@ -67,7 +67,7 @@ function ResizeControl({
};
},
onChange: (change: XYResizerChange, childChanges: XYResizerChildChange[]) => {
const { triggerNodeChanges, nodeLookup } = store.getState();
const { triggerNodeChanges, nodeLookup, parentLookup } = store.getState();
const changes: NodeChange[] = [];
const newPosition = { x: change.x, y: change.y };
@@ -86,7 +86,7 @@ function ResizeControl({
const nodeWith = evaluateNodePosition(nodeWithChange, nodeLookup) as InternalNodeWithParentExpand;
const parentExpandChanges = handleParentExpand([nodeWith], nodeLookup);
const parentExpandChanges = handleParentExpand([nodeWith], nodeLookup, parentLookup);
changes.push(...parentExpandChanges);
newPosition.x = change.x ? Math.max(0, change.x) : undefined;
newPosition.y = change.y ? Math.max(0, change.y) : undefined;