Skip to content

Commit 87d6d18

Browse files
authored
Fix linear mode with vue (#6769)
Previously, entering linear mode from vue mode would cause all nodes to be set to position 0. This is fixed by ignoring resize updates with a contentRect of all 0s ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6769-Fix-linear-mode-with-vue-2b16d73d36508188964bcfb8b465dcb1) by [Unito](https://www.unito.io)
1 parent 87106cc commit 87d6d18

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/renderer/extensions/vueNodes/composables/useVueNodeResizeTracking.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type { MaybeRefOrGetter } from 'vue'
1414
import { useSharedCanvasPositionConversion } from '@/composables/element/useCanvasPositionConversion'
1515
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
1616
import { layoutStore } from '@/renderer/core/layout/store/layoutStore'
17+
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
1718
import type { Bounds, NodeId } from '@/renderer/core/layout/types'
1819
import { LayoutSource } from '@/renderer/core/layout/types'
1920

@@ -60,6 +61,7 @@ const trackingConfigs: Map<string, ElementTrackingConfig> = new Map([
6061

6162
// Single ResizeObserver instance for all Vue elements
6263
const resizeObserver = new ResizeObserver((entries) => {
64+
if (useCanvasStore().linearMode) return
6365
// Canvas is ready when this code runs; no defensive guards needed.
6466
const conv = useSharedCanvasPositionConversion()
6567
// Group updates by type, then flush via each config's handler

0 commit comments

Comments
 (0)