diff --git a/samples/ControlCatalog/Pages/ImagePage.xaml.cs b/samples/ControlCatalog/Pages/ImagePage.xaml.cs index 511b01c7ac..00878dc5a8 100644 --- a/samples/ControlCatalog/Pages/ImagePage.xaml.cs +++ b/samples/ControlCatalog/Pages/ImagePage.xaml.cs @@ -70,7 +70,7 @@ namespace ControlCatalog.Pages 3 => new PixelRect(new PixelPoint(bitmapWidth - cropSize.Width, 0), cropSize), 4 => new PixelRect(new PixelPoint(0, bitmapHeight - cropSize.Height), cropSize), 5 => new PixelRect(new PixelPoint(bitmapWidth - cropSize.Width, bitmapHeight - cropSize.Height), cropSize), - _ => PixelRect.Empty + _ => PixelRect.Default }; } diff --git a/src/Avalonia.Base/PixelRect.cs b/src/Avalonia.Base/PixelRect.cs index 409a259182..330edbd872 100644 --- a/src/Avalonia.Base/PixelRect.cs +++ b/src/Avalonia.Base/PixelRect.cs @@ -10,9 +10,13 @@ namespace Avalonia public readonly struct PixelRect : IEquatable { /// - /// An empty rectangle. + /// A shared default instance representing an empty rectangle. /// - public static readonly PixelRect Empty = default; + public static readonly PixelRect Default = default; + + /// + [Obsolete("Use Default instead.")] + public static readonly PixelRect Empty = Default; /// /// Initializes a new instance of the structure. @@ -261,7 +265,7 @@ namespace Avalonia } else { - return Empty; + return Default; } }