Skip to content

Commit 558de97

Browse files
Bad hack to attempt to close path
1 parent bed3722 commit 558de97

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/ImageSharp.Drawing/Shapes/PolygonClipper/PolygonStroker.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ public double MiterLimitTheta
6262

6363
public Polygon ProcessPath(ReadOnlySpan<PointF> pathPoints)
6464
{
65-
for (int i = 0; i < pathPoints.Length - 1; i++)
65+
for (int i = 0; i < pathPoints.Length; i++)
6666
{
6767
PointF point = pathPoints[i];
6868
this.AddVertex(point.X, point.Y, PathCommand.LineTo);
6969
}
7070

71-
// This doesn't actually add the point. It triggers a close.
72-
this.AddVertex(pathPoints[^1].X, pathPoints[^1].Y, PathCommand.EndPoly);
71+
this.AddVertex(pathPoints[^1].X, pathPoints[^1].Y, PathCommand.LineTo);
72+
this.closed = 1;
73+
this.Rewind();
7374

7475
double x = 0;
7576
double y = 0;

0 commit comments

Comments
 (0)