mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
Notify layers panel on layer changes
Added calls to canvasLayersPanel.onLayersChanged() after pasting, adding, and fusing layers to ensure the layers panel updates its view in response to these actions.
This commit is contained in:
@@ -128,6 +128,12 @@ export class CanvasLayers {
|
||||
|
||||
this.canvas.updateSelection(newLayers);
|
||||
this.canvas.render();
|
||||
|
||||
// Notify the layers panel to update its view
|
||||
if (this.canvas.canvasLayersPanel) {
|
||||
this.canvas.canvasLayersPanel.onLayersChanged();
|
||||
}
|
||||
|
||||
log.info(`Pasted ${newLayers.length} layer(s) at mouse position (${mouseX}, ${mouseY}).`);
|
||||
}
|
||||
|
||||
@@ -192,6 +198,11 @@ export class CanvasLayers {
|
||||
this.canvas.render();
|
||||
this.canvas.saveState();
|
||||
|
||||
// Notify the layers panel to update its view
|
||||
if (this.canvas.canvasLayersPanel) {
|
||||
this.canvas.canvasLayersPanel.onLayersChanged();
|
||||
}
|
||||
|
||||
log.info("Layer added successfully");
|
||||
return layer;
|
||||
}, 'CanvasLayers.addLayerWithImage');
|
||||
@@ -1158,6 +1169,11 @@ export class CanvasLayers {
|
||||
this.canvas.render();
|
||||
this.canvas.saveState();
|
||||
|
||||
// Notify the layers panel to update its view
|
||||
if (this.canvas.canvasLayersPanel) {
|
||||
this.canvas.canvasLayersPanel.onLayersChanged();
|
||||
}
|
||||
|
||||
log.info("Layers fused successfully", {
|
||||
originalLayerCount: sortedSelection.length,
|
||||
fusedDimensions: { width: fusedWidth, height: fusedHeight },
|
||||
|
||||
Reference in New Issue
Block a user