refactor(core): only apply new positions if there are changes
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -156,8 +156,14 @@ until(() => node.initialized)
|
|||||||
function updatePosition() {
|
function updatePosition() {
|
||||||
const { computedPosition, position } = calcNextPosition(node, node.computedPosition, nodeExtent, parentNode)
|
const { computedPosition, position } = calcNextPosition(node, node.computedPosition, nodeExtent, parentNode)
|
||||||
|
|
||||||
node.computedPosition = { ...node.computedPosition, ...computedPosition }
|
// only overwrite positions if there are changes when clamping
|
||||||
node.position = position
|
if (node.computedPosition.x !== computedPosition.x || node.computedPosition.y !== computedPosition.y) {
|
||||||
|
node.computedPosition = { ...node.computedPosition, ...computedPosition }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node.position.x !== position.x || node.position.y !== position.y) {
|
||||||
|
node.position = position
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateInternals() {
|
function updateInternals() {
|
||||||
|
|||||||
Reference in New Issue
Block a user