[backport core/1.32] fix: Vue Node <-> Litegraph node height offset normalization (#6975)

## Summary
Backport of #6966 onto core/1.32.

- cherry-picked 29dbfa3f and accepted upstream snapshot updates during
conflict resolution (used the commit's PNG expectations)
- no additional code changes beyond the original patch

## Testing
- pnpm typecheck

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6975-backport-core-1-32-fix-Vue-Node-Litegraph-node-height-offset-normalization-2b86d73d3650819a860dd922bdbc20ff)
by [Unito](https://www.unito.io)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Christian Byrne
2025-11-26 17:10:22 -08:00
committed by GitHub
parent 8f527e846f
commit 5226de2963
24 changed files with 159 additions and 23 deletions

View File

@@ -11,6 +11,7 @@ import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
import { useLayoutMutations } from '@/renderer/core/layout/operations/layoutMutations'
import { layoutStore } from '@/renderer/core/layout/store/layoutStore'
import { useLayoutSync } from '@/renderer/core/layout/sync/useLayoutSync'
import { removeNodeTitleHeight } from '@/renderer/core/layout/utils/nodeSizeUtil'
import { ensureCorrectLayoutScale } from '@/renderer/extensions/vueNodes/layout/ensureCorrectLayoutScale'
import { app as comfyApp } from '@/scripts/app'
import { useToastStore } from '@/platform/updates/common/toastStore'
@@ -44,7 +45,10 @@ function useVueNodeLifecycleIndividual() {
const nodes = activeGraph._nodes.map((node: LGraphNode) => ({
id: node.id.toString(),
pos: [node.pos[0], node.pos[1]] as [number, number],
size: [node.size[0], node.size[1]] as [number, number]
size: [node.size[0], removeNodeTitleHeight(node.size[1])] as [
number,
number
]
}))
layoutStore.initializeFromLiteGraph(nodes)