Update fill layer when mask is created or deleted

This commit is contained in:
luboslenco
2023-03-15 15:16:01 +01:00
parent 08a1cd18ba
commit 3d0656a467
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -51,6 +51,7 @@ class TabLayers {
App.notifyOnNextFrame(_next);
Context.raw.layerPreviewDirty = true;
History.newBlackMask();
App.updateFillLayers();
}
if (ui.button(tr("White Mask"), Left)) {
if (l.isMask()) Context.setLayer(l.parent);
@@ -63,6 +64,7 @@ class TabLayers {
App.notifyOnNextFrame(_next);
Context.raw.layerPreviewDirty = true;
History.newWhiteMask();
App.updateFillLayers();
}
if (ui.button(tr("Fill Mask"), Left)) {
if (l.isMask()) Context.setLayer(l.parent);
@@ -75,6 +77,7 @@ class TabLayers {
iron.App.notifyOnInit(_init);
Context.raw.layerPreviewDirty = true;
History.newFillMask();
App.updateFillLayers();
}
ui.enabled = !Context.raw.layer.isGroup() && !Context.raw.layer.isInGroup();
if (ui.button(tr("Group"), Left)) {
@@ -836,11 +839,16 @@ class TabLayers {
}
}
}
Context.raw.layer = l;
History.deleteLayer();
l.delete();
if (l.isMask()) {
Context.raw.layer = l.parent;
App.updateFillLayers();
}
// Remove empty group
if (l.isInGroup() && l.getContainingGroup().getChildren() == null) {
var g = l.getContainingGroup();
+1
View File
@@ -94,6 +94,7 @@ class UIHeader {
UIToolbar.inst.toolbarHandle.redraws = 1;
UIHeader.inst.headerHandle.redraws = 1;
Context.raw.layerPreviewDirty = true;
App.updateFillLayers();
}
App.notifyOnNextFrame(_next);
History.newWhiteMask();