Fix matting: refresh image after background removal

Fixed an issue where images were not immediately refreshed after background removal (matting). Now, the canvas updates instantly when the background is removed, ensuring correct display without requiring manual scaling or other actions.
This commit is contained in:
Dariusz L
2025-08-03 22:14:39 +02:00
parent 3c3e6934d7
commit 3d34bfafd5
4 changed files with 18 additions and 20 deletions

View File

@@ -430,6 +430,8 @@ async function createCanvasWidget(node, widget, app) {
delete newLayer.imageId;
canvas.layers[selectedLayerIndex] = newLayer;
canvas.canvasSelection.updateSelection([newLayer]);
// Invalidate processed image cache when layer image changes (matting)
canvas.canvasLayers.invalidateProcessedImageCache(newLayer.id);
canvas.render();
canvas.saveState();
showSuccessNotification("Background removed successfully!");