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
+2 -2
View File
@@ -94,7 +94,7 @@ function useDrag(params: UseDragParams) {
nextPosition.y = snapY * Math.round(nextPosition.y / snapY)
}
const { position } = calcNextPosition(
const { computedPosition } = calcNextPosition(
n,
nextPosition,
nodeExtent,
@@ -104,7 +104,7 @@ function useDrag(params: UseDragParams) {
// we want to make sure that we only fire a change event when there is a changes
hasChange = hasChange || n.position.x !== nextPosition.x || n.position.y !== nextPosition.y
n.position = position
n.position = computedPosition
return n
})