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:
Dariusz L
2025-07-02 10:16:59 +02:00
parent d2ccfc4e20
commit d1004d5864

View File

@@ -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 },