fix(ui): after canceling a filter, layer loses its content

This commit is contained in:
psychedelicious
2025-07-03 07:38:28 +10:00
parent f36d22f13c
commit f0a6c4aa1f

View File

@@ -424,9 +424,15 @@ export class CanvasEntityFilterer extends CanvasModuleBase {
// the user has applied the filter and the image has been adopted by the parent entity.
if (this.imageModule && this.imageModule.konva.group.parent === this.konva.group) {
this.imageModule.destroy();
this.imageModule = null;
}
// When a filter is applied, the image module is adopted by the parent entity as a "permanent" module.
// Null this reference to prevent the filter module from accidentally trying to destroy a module that the
// parent entity is now responsible for.
this.imageModule = null;
const initialFilterConfig = deepClone(this.$initialFilterConfig.get() ?? this.createInitialFilterConfig());
this.$filterConfig.set(initialFilterConfig);
this.$imageState.set(null);
this.$lastProcessedHash.set('');