File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
src/ImageSharp.Drawing/Shapes/PolygonClipper Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,7 @@ public ComplexPolygon Execute(float width)
3232 for ( int i = 0 ; i < solution . Count ; i ++ )
3333 {
3434 PathF pt = solution [ i ] ;
35- PointF [ ] points = new PointF [ pt . Count ] ;
36- for ( int j = 0 ; j < pt . Count ; j ++ )
37- {
38- points [ j ] = pt [ j ] ;
39- }
35+ PointF [ ] points = pt . ToArray ( ) ;
4036
4137 polygons [ i ] = new Polygon ( points ) ;
4238 }
@@ -53,10 +49,7 @@ public ComplexPolygon Execute(float width)
5349 public void AddPath ( ReadOnlySpan < PointF > pathPoints , JointStyle jointStyle , EndCapStyle endCapStyle )
5450 {
5551 PathF points = new ( pathPoints . Length ) ;
56- for ( int i = 0 ; i < pathPoints . Length ; i ++ )
57- {
58- points . Add ( pathPoints [ i ] ) ;
59- }
52+ points . AddRange ( pathPoints ) ;
6053
6154 this . polygonClipperOffset . AddPath ( points , jointStyle , endCapStyle ) ;
6255 }
Original file line number Diff line number Diff line change @@ -643,7 +643,7 @@ private class Group
643643 {
644644 public Group ( PathsF paths , JointStyle joinType , EndCapStyle endType = EndCapStyle . Polygon )
645645 {
646- this . InPaths = new PathsF ( paths ) ;
646+ this . InPaths = paths ;
647647 this . JoinType = joinType ;
648648 this . EndType = endType ;
649649 this . OutPath = new PathF ( ) ;
You can’t perform that action at this time.
0 commit comments