@@ -20,6 +20,7 @@ public sealed class ComplexPolygon : IPath, IPathInternals, IInternalPathOwner
2020 private readonly IPath [ ] paths ;
2121 private readonly List < InternalPath > internalPaths ;
2222 private readonly int maxIntersections ;
23+ private readonly float length ;
2324
2425 /// <summary>
2526 /// Initializes a new instance of the <see cref="ComplexPolygon" /> class.
@@ -52,7 +53,6 @@ public ComplexPolygon(params IPath[] paths)
5253
5354 foreach ( IPath p in this . paths )
5455 {
55- length += p . Length ;
5656 if ( p . Bounds . Left < minX )
5757 {
5858 minX = p . Bounds . Left ;
@@ -77,30 +77,25 @@ public ComplexPolygon(params IPath[] paths)
7777 {
7878 var ip = new InternalPath ( s . Points , s . IsClosed ) ;
7979 intersections += ip . PointCount ;
80-
80+ length += ip . Length ;
8181 this . internalPaths . Add ( ip ) ;
8282 }
8383 }
8484
8585 this . maxIntersections = intersections ;
86- this . Length = length ;
86+ this . length = length ;
8787 this . Bounds = new RectangleF ( minX , minY , maxX - minX , maxY - minY ) ;
8888 }
8989 else
9090 {
9191 this . maxIntersections = 0 ;
92- this . Length = 0 ;
92+ this . length = 0 ;
9393 this . Bounds = RectangleF . Empty ;
9494 }
9595
9696 this . PathType = PathTypes . Mixed ;
9797 }
9898
99- /// <summary>
100- /// Gets the length of the path.
101- /// </summary>
102- public float Length { get ; }
103-
10499 /// <summary>
105100 /// Gets a value indicating whether this instance is closed, open or a composite path with a mixture of open and closed figures.
106101 /// </summary>
@@ -271,7 +266,7 @@ public IPath AsClosedPath()
271266 /// </returns>
272267 SegmentInfo IPathInternals . PointAlongPath ( float distance )
273268 {
274- distance %= this . Length ;
269+ distance %= this . length ;
275270 foreach ( InternalPath p in this . internalPaths )
276271 {
277272 if ( p . Length >= distance )
0 commit comments