mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 02:44:58 +08:00
Check if CurrentSubpath is null in CloseSubpath()
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public PdfPoint CloseSubpath()
|
public PdfPoint? CloseSubpath()
|
||||||
{
|
{
|
||||||
return new PdfPoint();
|
return new PdfPoint();
|
||||||
}
|
}
|
||||||
|
@@ -419,8 +419,13 @@
|
|||||||
CurrentSubpath = new PdfSubpath();
|
CurrentSubpath = new PdfSubpath();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PdfPoint CloseSubpath()
|
public PdfPoint? CloseSubpath()
|
||||||
{
|
{
|
||||||
|
if (CurrentSubpath == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
PdfPoint point;
|
PdfPoint point;
|
||||||
if (CurrentSubpath.Commands[0] is Move move)
|
if (CurrentSubpath.Commands[0] is Move move)
|
||||||
{
|
{
|
||||||
|
@@ -89,7 +89,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Close the current subpath.
|
/// Close the current subpath.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PdfPoint CloseSubpath();
|
PdfPoint? CloseSubpath();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add the current subpath to the path.
|
/// Add the current subpath to the path.
|
||||||
|
@@ -29,7 +29,11 @@
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Run(IOperationContext operationContext)
|
public void Run(IOperationContext operationContext)
|
||||||
{
|
{
|
||||||
operationContext.CurrentPosition = operationContext.CloseSubpath();
|
var point = operationContext.CloseSubpath();
|
||||||
|
if (point.HasValue)
|
||||||
|
{
|
||||||
|
operationContext.CurrentPosition = point.Value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
Reference in New Issue
Block a user