Browse Source

Fix BoxShadow equality (#19650)

fix/avnview-hittest
Julien Lebosquain 1 year ago
committed by GitHub
parent
commit
1f5182d811
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 13
      src/Avalonia.Base/Media/BoxShadow.cs

13
src/Avalonia.Base/Media/BoxShadow.cs

@ -74,13 +74,15 @@ namespace Avalonia.Media
/// <returns>
/// <c>true</c> if the current object is equal to the other parameter; otherwise, <c>false</c>.
/// </returns>
[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;
}
/// <inheritdoc/>
@ -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;
}
}

Loading…
Cancel
Save