fix(core): reapply node extent on change

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-01-04 13:46:28 +01:00
committed by Braks
parent 8e89f098d3
commit 94344a6d42

View File

@@ -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 }])