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 },
|
{ 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) {
|
function updatePosition(nodePos: XYZPosition, parentPos?: XYZPosition) {
|
||||||
let nextPos = nodePos
|
let nextPos = nodePos
|
||||||
|
|
||||||
@@ -141,14 +155,6 @@ function updatePosition(nodePos: XYZPosition, parentPos?: XYZPosition) {
|
|||||||
node.computedPosition = nextPos
|
node.computedPosition = nextPos
|
||||||
}
|
}
|
||||||
|
|
||||||
until(() => node.initialized)
|
|
||||||
.toBe(true)
|
|
||||||
.then(() => {
|
|
||||||
const { position } = calcNextPosition(node, node.computedPosition, nodeExtent, parentNode)
|
|
||||||
|
|
||||||
node.computedPosition = { ...node.computedPosition, ...position }
|
|
||||||
})
|
|
||||||
|
|
||||||
function updateInternals() {
|
function updateInternals() {
|
||||||
if (nodeElement.value) updateNodeDimensions([{ id, nodeElement: nodeElement.value, forceUpdate: true }])
|
if (nodeElement.value) updateNodeDimensions([{ id, nodeElement: nodeElement.value, forceUpdate: true }])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user