Browse Source

Disabled Merge with above/below for multiple selected layers

flabbet 4 years ago
parent
commit
7fe3421c20
1 changed files with 7 additions and 6 deletions
  1. 7 6
      PixiEditor/ViewModels/SubViewModels/Main/LayersViewModel.cs

+ 7 - 6
PixiEditor/ViewModels/SubViewModels/Main/LayersViewModel.cs

@@ -150,16 +150,17 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             Owner.BitmapManager.ActiveDocument.MergeLayers(new Layer[] { layer1, layer2 }, true);
             Owner.BitmapManager.ActiveDocument.MergeLayers(new Layer[] { layer1, layer2 }, true);
         }
         }
 
 
-        public bool CanMergeWithAbove(object propery)
+        public bool CanMergeWithAbove(object property)
         {
         {
-            int index = (int)propery;
-            return Owner.DocumentIsNotNull(null) && index != Owner.BitmapManager.ActiveDocument.Layers.Count - 1;
+            int index = (int)property;
+            return Owner.DocumentIsNotNull(null) && index != Owner.BitmapManager.ActiveDocument.Layers.Count - 1
+                && Owner.BitmapManager.ActiveDocument.Layers.Count(x => x.IsActive) == 1;
         }
         }
 
 
-        public bool CanMergeWithBelow(object propery)
+        public bool CanMergeWithBelow(object property)
         {
         {
-            int index = (int)propery;
-            return Owner.DocumentIsNotNull(null) && index != 0;
+            int index = (int)property;
+            return Owner.DocumentIsNotNull(null) && index != 0 && Owner.BitmapManager.ActiveDocument.Layers.Count(x => x.IsActive) == 1;
         }
         }
     }
     }
 }
 }