Browse Source

Updated icon and fixed recenter zoombox on resize canvas

flabbet 5 years ago
parent
commit
fa2d1c5459

+ 5 - 11
PixiEditor/Models/DataHolders/Document.cs

@@ -5,9 +5,6 @@ using PixiEditor.Models.Layers;
 using PixiEditor.Models.Position;
 using System;
 using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.DirectoryServices;
-using System.Drawing.Text;
 using System.Linq;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
@@ -77,18 +74,15 @@ namespace PixiEditor.Models.DataHolders
         /// <param name="height">New height</param>
         public void Crop(int x, int y, int width, int height)
         {
-            int oldWidth = Width;
-            int oldHeight = Height;
-
-            object[] reverseArgs = new object[] { 0, 0, x, y, Width, Height, width, height};
-            object[] processArgs = new object[] { x, y, 0, 0, width, height };
+            object[] reverseArgs = { 0, 0, x, y, Width, Height, width, height};
+            object[] processArgs = { x, y, 0, 0, width, height };
             ResizeDocumentCanvas(processArgs);
             UndoManager.AddUndoChange(new Change("BitmapManager.ActiveDocument", ResizeDocumentCanvas, 
                 reverseArgs, ResizeDocumentCanvas, processArgs, "Crop document"));
         }
 
         /// <summary>
-        /// Resizes canvas to specifid width and height to selected anchor
+        /// Resizes canvas to specified width and height to selected anchor
         /// </summary>
         /// <param name="width">New width of canvas</param>
         /// <param name="height">New height of canvas</param>
@@ -112,8 +106,8 @@ namespace PixiEditor.Models.DataHolders
                 offsetYSrc = offsetY;
                 offsetY = 0;
             }
-            object[] processArgs = new object[] { offsetXSrc, offsetYSrc, offsetX, offsetY, width, height };
-            object[] reverseProcessArgs = new object[] {offsetX, offsetY, offsetXSrc, offsetYSrc, Width, Height };
+            object[] processArgs = { offsetXSrc, offsetYSrc, offsetX, offsetY, width, height };
+            object[] reverseProcessArgs = {offsetX, offsetY, offsetXSrc, offsetYSrc, Width, Height };
 
             ResizeCanvas(offsetX, offsetY, offsetXSrc, offsetYSrc, Width, Height, width, height);
             UndoManager.AddUndoChange(new Change("BitmapManager.ActiveDocument", ResizeDocumentCanvas,

+ 1 - 1
PixiEditor/ViewModels/ViewModelMain.cs

@@ -376,7 +376,7 @@ namespace PixiEditor.ViewModels
         private void ActiveDocument_DocumentSizeChanged(object sender, DocumentSizeChangedEventArgs e)
         {
             ActiveSelection = new Selection(Array.Empty<Coordinates>());
-            RecenterZoombox = true;
+            RecenterZoombox = !RecenterZoombox;
             _unsavedDocumentModified = true;
         }
 

+ 1 - 1
PixiEditor/Views/ImportFilePopup.xaml.cs

@@ -12,7 +12,7 @@ namespace PixiEditor.Views
         public ImportFilePopup()
         {
             InitializeComponent();
-            this.DataContext = dc;
+            DataContext = dc;
         }
 
 

BIN
Zadania_Uzasadnij_tekst.pdf


BIN
icon.ico