浏览代码

Fixed expanded bug

flabbet 4 年之前
父节点
当前提交
a287580640

+ 3 - 0
PixiEditor/Models/DataHolders/Document/Document.Layers.cs

@@ -12,6 +12,7 @@ using PixiEditor.Models.Controllers;
 using PixiEditor.Models.Enums;
 using PixiEditor.Models.ImageManipulation;
 using PixiEditor.Models.Layers;
+using PixiEditor.Models.Layers.Utils;
 using PixiEditor.Models.Position;
 using PixiEditor.Models.Undo;
 
@@ -704,6 +705,8 @@ namespace PixiEditor.Models.DataHolders
 
                 var layerGroup = LayerStructure.GetGroupByLayer(layer.LayerGuid);
 
+                LayerStructure.ExpandParentGroups(layerGroup);
+
                 LayerStructure.AssignParent(Layers[index].LayerGuid, null);
                 RemoveGroupsIfEmpty(layer, layerGroup);
 

+ 1 - 1
PixiEditor/ViewModels/SubViewModels/Main/LayersViewModel.cs

@@ -72,7 +72,7 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
 
         public bool CanDeleteSelected(object parameter)
         {
-            return (parameter is not null and (Layer or LayerGroup)) || (Owner.BitmapManager?.ActiveDocument?.ActiveLayer != null);
+            return (parameter is not null and(Layer or LayerGroup)) || (Owner.BitmapManager?.ActiveDocument?.ActiveLayer != null);
         }
 
         public void DeleteSelected(object parameter)