mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 19:54:52 +08:00
Update PdfPath.cs
Need to account the case where a `Close` command is called but the first and last commands are not connected.
This commit is contained in:
@@ -200,6 +200,14 @@ namespace UglyToad.PdfPig.Geometry
|
||||
|
||||
internal void ClosePath()
|
||||
{
|
||||
if (currentPosition.HasValue)
|
||||
{
|
||||
var startPoint = GetStartPoint(commands.First());
|
||||
if (!startPoint.Equals(currentPosition.Value))
|
||||
{
|
||||
shoeLaceSum += (double)((startPoint.X - currentPosition.Value.X) * (startPoint.Y + currentPosition.Value.Y));
|
||||
}
|
||||
}
|
||||
commands.Add(new Close());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user