From 83890e6c4172f750fa08bddb082e934cb9f10605 Mon Sep 17 00:00:00 2001 From: Jason Heard Date: Sat, 10 Aug 2019 12:15:34 -0600 Subject: [PATCH] Add test illustrating issue --- .../Drawing/FillRegionProcessorTests.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs index c23ec9874..5320a58a6 100644 --- a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs @@ -12,6 +12,7 @@ using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; using SixLabors.ImageSharp.Processing.Processors.Drawing; +using SixLabors.Shapes; namespace SixLabors.ImageSharp.Tests.Drawing { @@ -68,6 +69,24 @@ namespace SixLabors.ImageSharp.Tests.Drawing } } + [Fact] + public void DoesNotThrowFillingTriangle() + { + using(var image = new Image(28, 28)) + { + var path = new Polygon( + new LinearLineSegment(new PointF(17.11f, 13.99659f), new PointF(14.01433f, 27.06201f)), + new LinearLineSegment(new PointF(14.01433f, 27.06201f), new PointF(13.79267f, 14.00023f)), + new LinearLineSegment(new PointF(13.79267f, 14.00023f), new PointF(17.11f, 13.99659f)) + ); + + image.Mutate(ctx => + { + ctx.Fill(Rgba32.White, path); + }); + } + } + // Mocking the region throws an error in netcore2.0 private class MockRegion1 : Region {