fix(react): node resizer use new width/height attr

This commit is contained in:
moklick
2023-11-21 16:08:13 +01:00
parent a166129547
commit 39b0deb9a4
2 changed files with 4 additions and 4 deletions

View File

@@ -70,8 +70,8 @@ function ResizeControl({
const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid });
prevValues.current = {
width: node?.width ?? 0,
height: node?.height ?? 0,
width: node?.computed?.width ?? 0,
height: node?.computed?.height ?? 0,
x: node?.position.x ?? 0,
y: node?.position.y ?? 0,
};

View File

@@ -254,8 +254,8 @@ export function calcNextPosition<NodeType extends NodeBase>(
? [
[parentPos.x + nodeWidth * currNodeOrigin[0], parentPos.y + nodeHeight * currNodeOrigin[1]],
[
parentPos.x + parentNode.computed?.width - nodeWidth + nodeWidth * currNodeOrigin[0],
parentPos.y + parentNode.computed?.height - nodeHeight + nodeHeight * currNodeOrigin[1],
parentPos.x + parentNode.computed.width - nodeWidth + nodeWidth * currNodeOrigin[0],
parentPos.y + parentNode.computed.height - nodeHeight + nodeHeight * currNodeOrigin[1],
],
]
: currentExtent;