mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
fix: force arrange() on Vue-to-legacy switch to prevent link header fallback
When switching from Vue to legacy mode, drawConnections (background canvas) can run before drawNode (foreground canvas) in the same frame, leaving input.pos unset and causing links to fall back to the node header. Force arrange() on all nodes immediately before setDirty so slot positions are ready for the first legacy render pass.
This commit is contained in:
@@ -86,6 +86,21 @@ function useVueNodeLifecycleIndividual() {
|
||||
() => !shouldRenderVueNodes.value,
|
||||
() => {
|
||||
disposeNodeManagerAndSyncs()
|
||||
|
||||
// Force arrange() on all nodes so input.pos is computed before
|
||||
// the first legacy drawConnections frame (which may run before
|
||||
// drawNode on the foreground canvas).
|
||||
const graph = comfyApp.canvas?.graph
|
||||
if (graph) {
|
||||
for (const node of graph._nodes) {
|
||||
try {
|
||||
if (!node.flags.collapsed) node.arrange()
|
||||
} catch {
|
||||
/* skip nodes not fully initialized */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
comfyApp.canvas?.setDirty(true, true)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user