(object)
| 24 | }; |
| 25 | |
| 26 | buildPath(object) { |
| 27 | let {path} = object; |
| 28 | |
| 29 | let curves = path.map(({x1, y1, x2, y2, x, y}, i) => ( |
| 30 | `C ${x1} ${y1}, ${x2} ${y2}, ${x} ${y}` |
| 31 | )); |
| 32 | |
| 33 | let instructions = [ |
| 34 | `M ${object.moveX} ${object.moveY}`, |
| 35 | ...curves |
| 36 | ]; |
| 37 | |
| 38 | if (object.closed) { |
| 39 | instructions = [ |
| 40 | ...instructions, 'Z' |
| 41 | ]; |
| 42 | } |
| 43 | |
| 44 | return instructions.join('\n'); |
| 45 | } |
| 46 | |
| 47 | getTransformMatrix({rotate, x, y, moveX, moveY}) { |
| 48 | return ` |