From e320afaf6485241c6cce5a4cbe367f17b85ba412 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Tue, 21 Apr 2020 15:39:37 +0200 Subject: [PATCH] debug size inequality --- Crow/src/Size.cs | 4 ++-- Samples/common/ui/templates/enumGetIcons.itmp | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 Samples/common/ui/templates/enumGetIcons.itmp diff --git a/Crow/src/Size.cs b/Crow/src/Size.cs index 18bc8b57..77347f06 100644 --- a/Crow/src/Size.cs +++ b/Crow/src/Size.cs @@ -30,7 +30,7 @@ namespace Crow public static implicit operator Size(string s)=> string.IsNullOrEmpty (s) ? Zero : Parse (s); public static bool operator == (Size s1, Size s2) => (s1.Width == s2.Width && s1.Height == s2.Height); - public static bool operator != (Size s1, Size s2) => (s1.Width == s2.Width && s1.Height == s2.Height); + public static bool operator != (Size s1, Size s2) => (s1.Width != s2.Width || s1.Height != s2.Height); public static bool operator > (Size s1, Size s2) => (s1.Width > s2.Width && s1.Height > s2.Height); public static bool operator >= (Size s1, Size s2) => (s1.Width >= s2.Width && s1.Height >= s2.Height); public static bool operator < (Size s1, Size s2) => (s1.Width < s2.Width) ? s1.Height <= s2.Height : @@ -41,7 +41,7 @@ namespace Crow public static bool operator >= (Size s, int i) => s.Width >= i && s.Height >= i; public static bool operator <= (Size s1, Size s2) => (s1.Width <= s2.Width && s1.Height <= s2.Height); public static bool operator == (Size s, int i) => (s.Width == i && s.Height == i); - public static bool operator != (Size s, int i) => (s.Width == i && s.Height == i); + public static bool operator != (Size s, int i) => (s.Width != i || s.Height != i); public static Size operator + (Size s1, Size s2) => new Size (s1.Width + s2.Width, s1.Height + s2.Height); public static Size operator + (Size s, int i) => new Size (s.Width + i, s.Height + i); public static Size operator * (Size s, int i) => new Size (s.Width * i, s.Height * i); diff --git a/Samples/common/ui/templates/enumGetIcons.itmp b/Samples/common/ui/templates/enumGetIcons.itmp new file mode 100644 index 00000000..048d495b --- /dev/null +++ b/Samples/common/ui/templates/enumGetIcons.itmp @@ -0,0 +1,7 @@ +