Fix swapping from linear to normal workflow

There was an attempted fitView with 0 visible area
Not super happy with location of fix
- FitView shouldn't cause total loss of functionality if called from
  invalid state
- As previously discussed, this fitview call should probably be moved to
  only apply on newly loaded workflow, not restored workflows
This commit is contained in:
Austin Mroz
2026-01-05 11:40:45 -08:00
parent 7cf8e89f44
commit 24500415cf

View File

@@ -1227,6 +1227,8 @@ export class ComfyApp {
// Fit view if no nodes visible in restored viewport
this.canvas.ds.computeVisibleArea(this.canvas.viewport)
if (
this.canvas.visible_area.width &&
this.canvas.visible_area.height &&
!anyItemOverlapsRect(
this.rootGraph._nodes,
this.canvas.visible_area