From a799f722420080991e9732bf2ac17378fbc7a327 Mon Sep 17 00:00:00 2001 From: robloo Date: Mon, 5 Dec 2022 07:33:08 -0500 Subject: [PATCH] Remove PixelRect.Default --- samples/ControlCatalog/Pages/ImagePage.xaml.cs | 2 +- src/Avalonia.Base/PixelRect.cs | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/samples/ControlCatalog/Pages/ImagePage.xaml.cs b/samples/ControlCatalog/Pages/ImagePage.xaml.cs index 00878dc5a8..5b3169a1b0 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.Default + _ => default }; } diff --git a/src/Avalonia.Base/PixelRect.cs b/src/Avalonia.Base/PixelRect.cs index 330edbd872..469f33e7fd 100644 --- a/src/Avalonia.Base/PixelRect.cs +++ b/src/Avalonia.Base/PixelRect.cs @@ -10,13 +10,10 @@ namespace Avalonia public readonly struct PixelRect : IEquatable { /// - /// A shared default instance representing an empty rectangle. + /// An empty rectangle. /// - public static readonly PixelRect Default = default; - - /// - [Obsolete("Use Default instead.")] - public static readonly PixelRect Empty = Default; + [Obsolete("Use the default keyword instead.")] + public static readonly PixelRect Empty = default; /// /// Initializes a new instance of the structure. @@ -265,7 +262,7 @@ namespace Avalonia } else { - return Default; + return default; } }