This repository has been archived by the owner on Jan 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
349 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using SixLabors.Primitives; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Xunit; | ||
|
||
namespace SixLabors.Shapes.Tests.Issues | ||
{ | ||
public class Issue_ClippedPaths | ||
{ | ||
[Fact] | ||
public void ClippedTriangle() | ||
{ | ||
Polygon simplePath = new Polygon(new LinearLineSegment( | ||
new PointF(10, 10), | ||
new PointF(200, 150), | ||
new PointF(50, 300))); | ||
|
||
Polygon hole1 = new Polygon(new LinearLineSegment( | ||
new PointF(37, 85), | ||
new PointF(93, 85), | ||
new PointF(65, 137))); | ||
|
||
var clippedPath = simplePath.Clip(hole1); | ||
var outline = clippedPath.GenerateOutline(5, new[] { 1f }); | ||
|
||
Assert.False(outline.Contains(new PointF(74, 97))); | ||
} | ||
} | ||
} |