Prechádzať zdrojové kódy

Merge conflicts fixes

flabbet 3 rokov pred
rodič
commit
5fa064651a

+ 0 - 10
PixiEditor/Models/DataHolders/Document/Document.Operations.cs

@@ -290,18 +290,8 @@ namespace PixiEditor.Models.DataHolders
             Thickness[] offset = (Thickness[])arguments[0];
             int width = (int)arguments[1];
             int height = (int)arguments[2];
-            PixelSize[] layersBounds = (PixelSize[])arguments[3];
             ResizeCanvas(offset, width, height);
-            RestoreLayerBounds(layersBounds);
             DocumentSizeChanged?.Invoke(this, new DocumentSizeChangedEventArgs(oldWidth, oldHeight, width, height));
         }
-
-        private void RestoreLayerBounds(PixelSize[] layersBounds)
-        {
-            for (int i = 0; i < layersBounds.Length; i++)
-            {
-                Layers[i].DynamicResizeAbsolute(new Int32Rect(Layers[i].OffsetX, Layers[i].OffsetY, layersBounds[i].Width, layersBounds[i].Height));
-            }
-        }
     }
 }

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

@@ -132,13 +132,11 @@ namespace PixiEditor.Models.DataHolders
             Thickness[] oldOffsets = Layers.Select(x => x.Offset).ToArray();
             int oldWidth = Width;
             int oldHeight = Height;
-            PixelSize diff = new PixelSize(Math.Abs(width - oldWidth), Math.Abs(height - oldHeight));
-            PixelSize[] oldSize = Layers.Select(x => x.GetSize()).ToArray();
 
             MoveOffsets(Layers, moveVector);
 
-            object[] reverseArguments = { oldOffsets, oldWidth, oldHeight, oldSize };
-            object[] processArguments = { Layers.Select(x => x.Offset).ToArray(), width, height, Layers.Select(x => x.GetSize() + diff).ToArray() };
+            object[] reverseArguments = { oldOffsets, oldWidth, oldHeight };
+            object[] processArguments = { Layers.Select(x => x.Offset).ToArray(), width, height };
 
             ResizeCanvasProcess(processArguments);
 

+ 0 - 22
PixiEditor/Models/DataHolders/PixelSize.cs

@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PixiEditor.Models.DataHolders
-{
-    public struct PixelSize
-    {
-        public int Height { get; set; }
-        public int Width { get; set; }
-
-        public PixelSize(int height, int width)
-        {
-            Height = height;
-            Width = width;
-        }
-
-        public static PixelSize operator +(PixelSize first, PixelSize second) => new PixelSize(first.Width + second.Width, first.Height + second.Height);
-    }
-}

+ 0 - 1
PixiEditor/Models/Layers/Layer.cs

@@ -528,7 +528,6 @@ namespace PixiEditor.Models.Layers
         }
 
         public SKRectI GetRect() => SKRectI.Create(OffsetX, OffsetY, Width, Height);
-        public PixelSize GetSize() => new PixelSize(Width, Height);
 
         public void CropIntersect(SKRectI rect)
         {