Browse Source

Merge pull request #25 from PixiEditor/dev

Fixed swapped width and height in export dialog
Krzysztof Krysiński 5 years ago
parent
commit
00310686e1

+ 1 - 1
PixiEditor/Models/IO/Exporter.cs

@@ -56,7 +56,7 @@ namespace PixiEditor.Models.IO
                 }
 
                 FileDimensions = new Size(info.FileWidth, info.FileHeight);
-                SaveAsPng(info.FilePath, info.FileHeight, info.FileWidth, bitmap);
+                SaveAsPng(info.FilePath, info.FileWidth, info.FileHeight, bitmap);
             }
         }
 

+ 10 - 13
PixiEditor/Models/Position/Coordinates.cs

@@ -1,4 +1,6 @@
-namespace PixiEditor.Models.Position
+using System;
+
+namespace PixiEditor.Models.Position
 {
     public struct Coordinates
     {
@@ -29,22 +31,17 @@
 
         public override bool Equals(object obj)
         {
-            if (obj.GetType() != typeof(Coordinates)) return false;
-            return this == (Coordinates) obj;
+            if (obj is Coordinates coords)
+            {
+                return this == coords;
+            }
+
+            return false;
         }
 
         public override int GetHashCode()
         {
-            unchecked
-            {
-                const int hashingBase = (int) 2166136261;
-                const int hashingMultiplier = 16777619;
-
-                int hash = hashingBase;
-                hash = (hash * hashingMultiplier) ^ (!ReferenceEquals(null, X) ? X.GetHashCode() : 0);
-                hash = (hash * hashingMultiplier) ^ (!ReferenceEquals(null, Y) ? Y.GetHashCode() : 0);
-                return hash;
-            }
+            return HashCode.Combine(X, Y);
         }
     }
 }

+ 2 - 2
PixiEditor/ViewModels/ViewModelMain.cs

@@ -89,7 +89,7 @@ namespace PixiEditor.ViewModels
             set
             {
                 _mouseXonCanvas = value;
-                RaisePropertyChanged("MouseXonCanvas");
+                RaisePropertyChanged("MouseXOnCanvas");
             }
         }
 
@@ -99,7 +99,7 @@ namespace PixiEditor.ViewModels
             set
             {
                 _mouseYonCanvas = value;
-                RaisePropertyChanged("MouseYonCanvas");
+                RaisePropertyChanged("MouseYOnCanvas");
             }
         }