diff --git a/Terminal.Gui/Types/Rectangle.cs b/Terminal.Gui/Types/Rectangle.cs index 0b1c262b2..61e1ae1e3 100644 --- a/Terminal.Gui/Types/Rectangle.cs +++ b/Terminal.Gui/Types/Rectangle.cs @@ -261,7 +261,10 @@ public struct Rectangle /// GetHashCode Method /// Calculates a hashing value. - public override int GetHashCode () { return (Height + Width) ^ (X + Y); } + public override int GetHashCode () { return X ^ + ((Y << 13) | (Y >>> 19)) ^ + ((Width << 26) | (Width >>> 6)) ^ + ((Height << 7) | (Height >>> 25)); } /// IntersectsWith Method /// Checks if a Rectangle intersects with this one.