Fix layer selection on delete

This commit is contained in:
luboslenco
2020-03-26 22:28:23 +01:00
parent a0340a638d
commit dfcd1830ac
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ class LayerSlot {
var lpos = Project.layers.indexOf(this);
Project.layers.remove(this);
// Undo can remove base layer and then restore it from undo layers
if (lpos > 0) Context.setLayer(Project.layers[lpos - 1]);
Context.setLayer(Project.layers[lpos > 0 ? lpos - 1 : 0]);
}
public function unload() {
+1
View File
@@ -307,6 +307,7 @@ class TabLayers {
if (l.parent != null && l.parent.getChildren() == null) {
l.parent.delete();
}
Context.ddirty = 2;
}
}
if (ui.button(tr("Move Up"), Left)) {