diff --git a/src/Avalonia.Visuals/Media/BoxShadows.cs b/src/Avalonia.Visuals/Media/BoxShadows.cs index fd187f6409..9e4d6aacb0 100644 --- a/src/Avalonia.Visuals/Media/BoxShadows.cs +++ b/src/Avalonia.Visuals/Media/BoxShadows.cs @@ -21,7 +21,7 @@ namespace Avalonia.Media { _first = shadow; _list = null; - Count = 1; + Count = _first.IsEmpty ? 0 : 1; } public BoxShadows(BoxShadow first, BoxShadow[] rest) @@ -105,8 +105,6 @@ namespace Avalonia.Media return false; } } - - public static implicit operator BoxShadows(BoxShadow shadow) => new BoxShadows(shadow); public bool Equals(BoxShadows other) { diff --git a/src/Avalonia.Visuals/Media/DrawingContext.cs b/src/Avalonia.Visuals/Media/DrawingContext.cs index 4df26c470d..1a45b8342a 100644 --- a/src/Avalonia.Visuals/Media/DrawingContext.cs +++ b/src/Avalonia.Visuals/Media/DrawingContext.cs @@ -141,13 +141,13 @@ namespace Avalonia.Media /// The radius in the Y dimension of the rounded corners. /// This value will be clamped to the range of 0 to Height/2 /// - /// Box shadow effect parameters + /// Box shadow effect parameters /// /// The brush and the pen can both be null. If the brush is null, then no fill is performed. /// If the pen is null, then no stoke is performed. If both the pen and the brush are null, then the drawing is not visible. /// public void DrawRectangle(IBrush brush, IPen pen, Rect rect, double radiusX = 0, double radiusY = 0, - BoxShadow boxShadow = default) + BoxShadows boxShadows = default) { if (brush == null && !PenIsVisible(pen)) { @@ -164,7 +164,7 @@ namespace Avalonia.Media radiusY = Math.Min(radiusY, rect.Height / 2); } - PlatformImpl.DrawRectangle(brush, pen, new RoundedRect(rect, radiusX, radiusY), boxShadow); + PlatformImpl.DrawRectangle(brush, pen, new RoundedRect(rect, radiusX, radiusY), boxShadows); } ///