1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.reverseCurve = void 0;
|
4 |
|
5 | function reverseCurve(pathArray) {
|
6 | var rotatedCurve = pathArray
|
7 | .slice(1)
|
8 | .map(function (x, i, curveOnly) {
|
9 |
|
10 | return !i ? pathArray[0].slice(1).concat(x.slice(1)) : curveOnly[i - 1].slice(-2).concat(x.slice(1));
|
11 | })
|
12 |
|
13 | .map(function (x) { return x.map(function (y, i) { return x[x.length - i - 2 * (1 - (i % 2))]; }); })
|
14 | .reverse();
|
15 | return [['M'].concat(rotatedCurve[0].slice(0, 2))].concat(rotatedCurve.map(function (x) { return ['C'].concat(x.slice(2)); }));
|
16 | }
|
17 | exports.reverseCurve = reverseCurve;
|
18 |
|
\ | No newline at end of file |