Skip to content

Commit 15dad17

Browse files
committed
add PolygonScannerTests.OutOfBounds
1 parent 977c170 commit 15dad17

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/ImageSharp.Drawing.Tests/Shapes/Scan/PolygonScannerTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,25 @@ public void NegativeOrientation01(IntersectionRule intersectionRule)
426426
this.TestScan(poly, 0, 2, 2, expected, intersectionRule);
427427
}
428428

429+
[Fact]
430+
public void OutOfBounds()
431+
{
432+
IPath poly = PolygonFactory.CreatePolygon((1, -5), (5, -5), (5, -3), (10, -1), (10, 2), (12, 4), (1, 4));
433+
434+
FuzzyFloat[][] exected =
435+
{
436+
new FuzzyFloat[] { 1, 10 },
437+
new FuzzyFloat[] { 1, 10 },
438+
new FuzzyFloat[] { 1, 10 },
439+
new FuzzyFloat[] { 1, 10 },
440+
new FuzzyFloat[] { 1, 10 },
441+
new FuzzyFloat[] { 1, 10.5 },
442+
new FuzzyFloat[] { 1, 11 },
443+
};
444+
445+
this.TestScan(poly, 0, 3, 2, exected);
446+
}
447+
429448
private static (float y, FuzzyFloat[] x) Empty(float y) => (y, new FuzzyFloat[0]);
430449

431450
private static FuzzyFloat F(float x, float eps) => new FuzzyFloat(x, eps);

0 commit comments

Comments
 (0)