diff --git a/src/Core/src/Graphics/MauiDrawable.Android.cs b/src/Core/src/Graphics/MauiDrawable.Android.cs index 95960e4ab3c3..fa75f04c4513 100644 --- a/src/Core/src/Graphics/MauiDrawable.Android.cs +++ b/src/Core/src/Graphics/MauiDrawable.Android.cs @@ -270,7 +270,7 @@ public void SetBorderWidth(double strokeWidth) public void SetBorderDash(float[]? strokeDashArray, double strokeDashOffset) { - if (strokeDashArray == null || strokeDashArray.Length == 0 || strokeDashOffset <= 0) + if (strokeDashArray is null || strokeDashArray.Length == 0) _borderPathEffect = null; else { diff --git a/src/Core/tests/DeviceTests/Handlers/Border/BorderHandlerTests.cs b/src/Core/tests/DeviceTests/Handlers/Border/BorderHandlerTests.cs index 111481f6aaf5..c89b32e79f72 100644 --- a/src/Core/tests/DeviceTests/Handlers/Border/BorderHandlerTests.cs +++ b/src/Core/tests/DeviceTests/Handlers/Border/BorderHandlerTests.cs @@ -53,6 +53,29 @@ public async Task StrokeInitializesCorrectly(uint color) await ValidateHasColor(border, expected); } + [Theory(DisplayName = "Dashed Stroke Initializes Correctly")] + [InlineData(0xFFFF0000)] + [InlineData(0xFF00FF00)] + [InlineData(0xFF0000FF)] + public async Task DashedStrokeInitializesCorrectly(uint color) + { + var expected = Color.FromUint(color); + + var border = new BorderStub() + { + Content = new LabelStub { Text = "Stroke", TextColor = Colors.Black }, + Shape = new RectangleShapeStub(), + Background = new SolidPaintStub(Colors.White), + Stroke = new SolidPaintStub(expected), + StrokeDashPattern = new float[2] { 1, 1 }, + StrokeThickness = 6, + Height = 100, + Width = 300 + }; + + await ValidateHasColor(border, expected); + } + [Theory(DisplayName = "StrokeShape Initializes Correctly")] [InlineData("Rectangle")] [InlineData("RoundRectangle")]