Browse Source

fix #132, layers now line up after document resize

Equbuxu 4 years ago
parent
commit
f545d971b7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      PixiEditor/Models/DataHolders/Document.cs

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

@@ -483,7 +483,7 @@ namespace PixiEditor.Models.DataHolders
                 int layerHeight = (int)(Layers[i].Height * heightRatio);
                 int layerHeight = (int)(Layers[i].Height * heightRatio);
 
 
                 Layers[i].Resize(layerWidth, layerHeight, newWidth, newHeight);
                 Layers[i].Resize(layerWidth, layerHeight, newWidth, newHeight);
-                Layers[i].Offset = new Thickness(Layers[i].OffsetX * widthRatio, Layers[i].OffsetY * heightRatio, 0, 0);
+                Layers[i].Offset = new Thickness(Math.Floor(Layers[i].OffsetX * widthRatio), Math.Floor(Layers[i].OffsetY * heightRatio), 0, 0);
             }
             }
 
 
             Height = newHeight;
             Height = newHeight;