fix(core): reapply node extent on change
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -131,6 +131,20 @@ watch(
|
||||
{ flush: 'pre', immediate: true },
|
||||
)
|
||||
|
||||
watch([() => node.extent, () => nodeExtent], () => {
|
||||
const { position } = calcNextPosition(node, node.computedPosition, nodeExtent, parentNode)
|
||||
|
||||
node.computedPosition = { ...node.computedPosition, ...position }
|
||||
})
|
||||
|
||||
until(() => node.initialized)
|
||||
.toBe(true)
|
||||
.then(() => {
|
||||
const { position } = calcNextPosition(node, node.computedPosition, nodeExtent, parentNode)
|
||||
|
||||
node.computedPosition = { ...node.computedPosition, ...position }
|
||||
})
|
||||
|
||||
function updatePosition(nodePos: XYZPosition, parentPos?: XYZPosition) {
|
||||
let nextPos = nodePos
|
||||
|
||||
@@ -141,14 +155,6 @@ function updatePosition(nodePos: XYZPosition, parentPos?: XYZPosition) {
|
||||
node.computedPosition = nextPos
|
||||
}
|
||||
|
||||
until(() => node.initialized)
|
||||
.toBe(true)
|
||||
.then(() => {
|
||||
const { position } = calcNextPosition(node, node.computedPosition, nodeExtent, parentNode)
|
||||
|
||||
node.computedPosition = { ...node.computedPosition, ...position }
|
||||
})
|
||||
|
||||
function updateInternals() {
|
||||
if (nodeElement.value) updateNodeDimensions([{ id, nodeElement: nodeElement.value, forceUpdate: true }])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user