(pathstr)
| 121173 | /\s|,|###/ |
| 121174 | ]; |
| 121175 | function pathParse(pathstr) { |
| 121176 | const result = []; |
| 121177 | let curr, chunks, parsed, param, cmd, len, i, j, n, m; // First, break path into command sequence |
| 121178 | const path1 = pathstr.slice().replace(regexp[0], "###$1").split(regexp[1]).slice(1); // Next, parse each command in turn |
| 121179 | for(i = 0, n = path1.length; i < n; ++i){ |
| 121180 | curr = path1[i]; |
| 121181 | chunks = curr.slice(1).trim().replace(regexp[2], "$1###$2").replace(regexp[3], "$1###$2").split(regexp[4]); |
| 121182 | cmd = curr.charAt(0); |
| 121183 | parsed = [ |
| 121184 | cmd |
| 121185 | ]; |
| 121186 | for(j = 0, m = chunks.length; j < m; ++j)if ((param = +chunks[j]) === param) // not NaN |
| 121187 | parsed.push(param); |
| 121188 | len = cmdlen[cmd.toLowerCase()]; |
| 121189 | if (parsed.length - 1 > len) { |
| 121190 | const m = parsed.length; |
| 121191 | j = 1; |
| 121192 | result.push([ |
| 121193 | cmd |
| 121194 | ].concat(parsed.slice(j, j += len))); // handle implicit lineTo (#2803) |
| 121195 | cmd = cmd === "M" ? "L" : cmd === "m" ? "l" : cmd; |
| 121196 | for(; j < m; j += len)result.push([ |
| 121197 | cmd |
| 121198 | ].concat(parsed.slice(j, j + len))); |
| 121199 | } else result.push(parsed); |
| 121200 | } |
| 121201 | return result; |
| 121202 | } |
| 121203 | const DegToRad = Math.PI / 180; |
| 121204 | const Epsilon = 1e-14; |
| 121205 | const HalfPi = Math.PI / 2; |
no test coverage detected