diff --git a/src/Core/src/Graphics/ShapeDrawable.cs b/src/Core/src/Graphics/ShapeDrawable.cs index d1e74a70e82f..43a8f21c16a3 100644 --- a/src/Core/src/Graphics/ShapeDrawable.cs +++ b/src/Core/src/Graphics/ShapeDrawable.cs @@ -100,10 +100,7 @@ void DrawFillPath(ICanvas canvas, RectF dirtyRect, PathF path) { if (ShapeView == null || ShapeView.Shape == null) return; - - if (!path.Closed) - return; - + canvas.SaveState(); canvas.FillColor = Colors.Transparent; diff --git a/src/Core/tests/DeviceTests/Handlers/ShapeView/ShapeViewHandlerTests.cs b/src/Core/tests/DeviceTests/Handlers/ShapeView/ShapeViewHandlerTests.cs index 20368c813373..4b16d664952d 100644 --- a/src/Core/tests/DeviceTests/Handlers/ShapeView/ShapeViewHandlerTests.cs +++ b/src/Core/tests/DeviceTests/Handlers/ShapeView/ShapeViewHandlerTests.cs @@ -117,5 +117,26 @@ public async Task PolygonInitializesCorrectly() await ValidateNativeFill(polygon, Colors.Lime); } + + [Theory(DisplayName = "Polyline Background Initializes Correctly")] + [InlineData(0xFF0000)] + [InlineData(0x00FF00)] + [InlineData(0x0000FF)] + public async Task PolylineBackgroundInitializesCorrectly(uint color) + { + var expected = Color.FromUint(color); + + var polyline = new ShapeViewStub() + { + Shape = new PolylineShapeStub { Points = new PointCollectionStub() { new Point(10, 10), new Point(100, 50), new Point(50, 90) } }, + Stroke = new SolidPaintStub(Colors.Green), + Background = new SolidPaintStub(expected), + StrokeThickness = 4, + Height = 50, + Width = 100 + }; + + await ValidateHasColor(polyline, expected); + } } }