Browse Source

Standardize Default member in PixelRect

pull/9590/head
robloo 4 years ago
parent
commit
5a743ad4c8
  1. 2
      samples/ControlCatalog/Pages/ImagePage.xaml.cs
  2. 10
      src/Avalonia.Base/PixelRect.cs

2
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
};
}

10
src/Avalonia.Base/PixelRect.cs

@ -10,9 +10,13 @@ namespace Avalonia
public readonly struct PixelRect : IEquatable<PixelRect>
{
/// <summary>
/// An empty rectangle.
/// A shared default instance representing an empty rectangle.
/// </summary>
public static readonly PixelRect Empty = default;
public static readonly PixelRect Default = default;
/// <inheritdoc cref="Default"/>
[Obsolete("Use Default instead.")]
public static readonly PixelRect Empty = Default;
/// <summary>
/// Initializes a new instance of the <see cref="PixelRect"/> structure.
@ -261,7 +265,7 @@ namespace Avalonia
}
else
{
return Empty;
return Default;
}
}

Loading…
Cancel
Save