diff --git a/ScreenCapture.NET/Model/Display.cs b/ScreenCapture.NET/Model/Display.cs index 7c749aa..bbf67a0 100644 --- a/ScreenCapture.NET/Model/Display.cs +++ b/ScreenCapture.NET/Model/Display.cs @@ -1,5 +1,7 @@ // ReSharper disable MemberCanBePrivate.Global +using System; + namespace ScreenCapture.NET; /// @@ -58,20 +60,20 @@ public readonly struct Display #endregion #region Methods - + /// /// Determines whether this equals the given one. /// /// The to compare. /// true if the specified object is equal to the current object; otherwise, false. - public bool Equals(Display other) => Index == other.Index; + public bool Equals(Display other) => (Index == other.Index) && GraphicsCard.Equals(other.GraphicsCard); /// public override bool Equals(object? obj) => obj is Display other && Equals(other); /// - public override int GetHashCode() => Index; - + public override int GetHashCode() => HashCode.Combine(Index, GraphicsCard); + /// /// Determines whether two are equal. /// diff --git a/ScreenCapture.NET/ScreenCapture.NET.csproj b/ScreenCapture.NET/ScreenCapture.NET.csproj index 2baac8f..6923e83 100644 --- a/ScreenCapture.NET/ScreenCapture.NET.csproj +++ b/ScreenCapture.NET/ScreenCapture.NET.csproj @@ -26,8 +26,9 @@ True - - Added IScreenCapture.UpdateCaptureZone to modify existing CaptureZones without having to remove and add them again. + - Added IScreenCapture.UpdateCaptureZone to modify existing CaptureZones without having to remove and add them again. (This has performance benefits when only X and/or Y is changed, changes to width, height and downscale are internally still reinitializing the zone.) + - Fixed ambiguous equals in Display 1.2.0