fix(core): node dimensions update condition to only force when dimensions defined

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2022-12-15 15:38:28 +01:00
committed by Braks
parent 657f33b845
commit 94c0883db8
2 changed files with 5 additions and 7 deletions
@@ -38,7 +38,6 @@ onMounted(() => {
return { return {
id, id,
nodeElement: entry.target as HTMLDivElement, nodeElement: entry.target as HTMLDivElement,
forceUpdate: true,
} }
}) })
+5 -6
View File
@@ -129,12 +129,11 @@ export function useActions(state: State, getters: ComputedGetters): Actions {
if (node) { if (node) {
const dimensions = getDimensions(update.nodeElement) const dimensions = getDimensions(update.nodeElement)
const doUpdate = const doUpdate = !!(
!!( dimensions.width &&
dimensions.width && dimensions.height &&
dimensions.height && (node.width !== dimensions.width || node.height !== dimensions.height || update.forceUpdate)
(node.dimensions.width !== dimensions.width || node.dimensions.height !== dimensions.height) )
) || update.forceUpdate
if (doUpdate) { if (doUpdate) {
node.handleBounds.source = getHandleBounds('.source', update.nodeElement, zoom) node.handleBounds.source = getHandleBounds('.source', update.nodeElement, zoom)