path.closestPointLength(point [, opt])
Return the length of the path up to the point that lies closest to
Invisible segments (e.g. Moveto segments) have no length and are therefore skipped by the algorithm; if the path contains no visible segments,
0 is returned. If the path has no segments at all,
0 is returned.
The function finds a visible segment whose identified closest point lies at the lowest distance from
point. It then determines the length of the path up to the identified closest point.
opt argument is optional. Two properties may be specified,
opt.segmentSubdivisions, which determine maximum error allowed in segment
closestPoint calculations for curved segments (default precision is 3; this corresponds to maximum observed error of 0.1%). The
opt.segmentSubdivisions property is an array of individual segments' subdivision arrays. The
path.getSegmentSubdivisions() function may be used to obtain the
segmentSubdivisions array. The
opt.precision property is still necessary, however; it determines the precision of the point search algorithm in curved segments.