mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-22 13:12:10 -03:00
Fix preview visibility initialization in Canvas
Replaces setPreviewVisibility(false) with direct assignment to previewVisible in Canvas and Canvas.ts. Adds initialization of preview state based on widget value in CanvasView and CanvasView.ts to ensure correct preview visibility on widget creation.
This commit is contained in:
@@ -132,7 +132,7 @@ export class Canvas {
|
||||
viewport: this.viewport
|
||||
});
|
||||
|
||||
this.setPreviewVisibility(false);
|
||||
this.previewVisible = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -730,6 +730,11 @@ async function createCanvasWidget(node: ComfyNode, widget: any, app: ComfyApp):
|
||||
node.setDirtyCanvas(true, true);
|
||||
}
|
||||
};
|
||||
|
||||
// Inicjalizuj stan preview na podstawie aktualnej wartości widget'u
|
||||
if (canvas && canvas.setPreviewVisibility) {
|
||||
canvas.setPreviewVisibility(showPreviewWidget.value);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user