fix(core): calculate position and computedPos correctly in calcNextPosition

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-01-05 13:06:26 +01:00
committed by Braks
parent 0c25796967
commit 6aec81532c
4 changed files with 28 additions and 11 deletions
@@ -16,11 +16,16 @@ function useUpdateNodePositions() {
const nodeUpdates = getSelectedNodes.value.map((n) => {
const nextPosition = { x: n.computedPosition.x + positionDiffX, y: n.computedPosition.y + positionDiffY }
const updatedPos = calcNextPosition(n, nextPosition, nodeExtent.value, n.parentNode ? findNode(n.parentNode) : undefined)
const { computedPosition } = calcNextPosition(
n,
nextPosition,
nodeExtent.value,
n.parentNode ? findNode(n.parentNode) : undefined,
)
return {
id: n.id,
position: updatedPos.position,
position: computedPosition,
from: n.position,
distance: { x: positionDiff.x, y: positionDiff.y },
dimensions: n.dimensions,