Browse Source

Add test illustrating issue

pull/964/head
Jason Heard 7 years ago
parent
commit
83890e6c41
  1. 19
      tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs

19
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<Rgba32>(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
{

Loading…
Cancel
Save