Merge pull request #1031 from MathemanFlo/FixMasksOnRemoveEmptyGroup
Move masks before removing an empty layer group
This commit is contained in:
@@ -529,23 +529,17 @@ class LayerSlot {
|
||||
if (this.parent == null && jParent != null && jParent.show_panel) {
|
||||
this.parent = jParent;
|
||||
}
|
||||
|
||||
var oldParent = null;
|
||||
// Moved out of group
|
||||
if (this.parent != null && kParent == null && !kIsGroup) {
|
||||
var parent = this.parent;
|
||||
oldParent = this.parent;
|
||||
this.parent = null;
|
||||
// Remove empty group
|
||||
if (parent.getChildren() == null) {
|
||||
parent.delete();
|
||||
}
|
||||
}
|
||||
// Moved to different group
|
||||
if (this.parent != null && ((kParent != null && kParent.show_panel) || kIsGroup)) {
|
||||
var parent = this.parent;
|
||||
oldParent = this.parent;
|
||||
this.parent = kIsGroup ? kLayer : kParent;
|
||||
// Remove empty group
|
||||
if (parent.getChildren() == null) {
|
||||
parent.delete();
|
||||
}
|
||||
}
|
||||
|
||||
var lmasks = this.getMasks();
|
||||
@@ -556,6 +550,11 @@ class LayerSlot {
|
||||
Project.layers.insert(delta > 0 ? i + delta - 1 : i + delta, mc);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove empty group
|
||||
if (oldParent != null && oldParent.getChildren() == null) {
|
||||
oldParent.delete();
|
||||
}
|
||||
}
|
||||
|
||||
for (m in Project.materials) TabLayers.remapLayerPointers(m.canvas.nodes, TabLayers.fillLayerMap(pointers));
|
||||
|
||||
Reference in New Issue
Block a user