From 1f5182d811a858a14ac7813cafd684e55f0f6294 Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Thu, 18 Sep 2025 10:20:01 +0200 Subject: [PATCH] Fix BoxShadow equality (#19650) --- src/Avalonia.Base/Media/BoxShadow.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Avalonia.Base/Media/BoxShadow.cs b/src/Avalonia.Base/Media/BoxShadow.cs index 7399bf121b..9ea2a992d7 100644 --- a/src/Avalonia.Base/Media/BoxShadow.cs +++ b/src/Avalonia.Base/Media/BoxShadow.cs @@ -74,13 +74,15 @@ namespace Avalonia.Media /// /// true if the current object is equal to the other parameter; otherwise, false. /// + [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator", Justification = "Bit equality is adequate here")] public bool Equals(in BoxShadow other) { - return OffsetX.Equals(other.OffsetX) - && OffsetY.Equals(other.OffsetY) - && Blur.Equals(other.Blur) - && Spread.Equals(other.Spread) - && Color.Equals(other.Color); + return OffsetX == other.OffsetX + && OffsetY == other.OffsetY + && Blur == other.Blur + && Spread == other.Spread + && Color.Equals(other.Color) + && IsInset == other.IsInset; } /// @@ -99,6 +101,7 @@ namespace Avalonia.Media hashCode = (hashCode * 397) ^ Blur.GetHashCode(); hashCode = (hashCode * 397) ^ Spread.GetHashCode(); hashCode = (hashCode * 397) ^ Color.GetHashCode(); + hashCode = (hashCode * 397) ^ IsInset.GetHashCode(); return hashCode; } }