(path, length, istotal)
| 29795 | } |
| 29796 | |
| 29797 | function pointAtLength(path, length, istotal) { |
| 29798 | path = path2curve(path); |
| 29799 | var x, y, p, l, sp = '', subpaths = {}, point, len = 0; |
| 29800 | for (var i = 0, ii = path.length; i < ii; i++) { |
| 29801 | p = path[i]; |
| 29802 | if (p[0] === 'M') { |
| 29803 | x = +p[1]; |
| 29804 | y = +p[2]; |
| 29805 | } else { |
| 29806 | l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]); |
| 29807 | if (len + l > length) { |
| 29808 | if (!istotal) { |
| 29809 | point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], |
| 29810 | p[6], length - len); |
| 29811 | return { x: point.x, y: point.y, alpha: point.alpha }; |
| 29812 | } |
| 29813 | } |
| 29814 | len += l; |
| 29815 | x = +p[5]; |
| 29816 | y = +p[6]; |
| 29817 | } |
| 29818 | sp += p.shift() + p; |
| 29819 | } |
| 29820 | subpaths.end = sp; |
| 29821 | |
| 29822 | point = istotal ? len : findDotsAtSegment |
| 29823 | (x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1); |
| 29824 | |
| 29825 | if (point.alpha) { |
| 29826 | point = { x: point.x, y: point.y, alpha: point.alpha }; |
| 29827 | } |
| 29828 | |
| 29829 | return point; |
| 29830 | } |
| 29831 | |
| 29832 | function pathToAbsolute(pathArray) { |
| 29833 |
no test coverage detected