Browse Source

Fixed center content undo

flabbet 3 years ago
parent
commit
cb66ec4270
1 changed files with 2 additions and 2 deletions
  1. 2 2
      PixiEditor/Models/DataHolders/Document/Document.cs

+ 2 - 2
PixiEditor/Models/DataHolders/Document/Document.cs

@@ -153,8 +153,8 @@ namespace PixiEditor.Models.DataHolders
         /// </summary>
         /// </summary>
         public void CenterContent()
         public void CenterContent()
         {
         {
-            var layersToCenter = Layers.Where(x => x.IsActive && LayerStructureUtils.GetFinalLayerIsVisible(x, LayerStructure));
-            if (!layersToCenter.Any())
+            var layersToCenter = Layers.Where(x => x.IsActive && LayerStructureUtils.GetFinalLayerIsVisible(x, LayerStructure)).ToArray();
+            if (layersToCenter.Length == 0)
             {
             {
                 return;
                 return;
             }
             }