Skip to content

Commit d63aabc

Browse files
Merge pull request #258 from stefannikolei/stefannikolei/convenience_constructor
Add convenience constructor to ComplexPolygon
2 parents 6a24a19 + 76a3d8d commit d63aabc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/ImageSharp.Drawing/Shapes/ComplexPolygon.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ public sealed class ComplexPolygon : IPath, IPathInternals, IInternalPathOwner
2020
private readonly List<InternalPath> internalPaths;
2121
private readonly float length;
2222

23+
/// <summary>
24+
/// Initializes a new instance of the <see cref="ComplexPolygon"/> class.
25+
/// </summary>
26+
/// <param name="contour">The contour path.</param>
27+
/// <param name="hole">The hole path.</param>
28+
public ComplexPolygon(PointF[] contour, PointF[] hole)
29+
: this(new Path(new LinearLineSegment(contour)), new Path(new LinearLineSegment(hole)))
30+
{
31+
}
32+
2333
/// <summary>
2434
/// Initializes a new instance of the <see cref="ComplexPolygon" /> class.
2535
/// </summary>

0 commit comments

Comments
 (0)