MCPcopy
hub / github.com/react-designer/react-designer / buildPath

Method buildPath

src/objects/Path.js:26–45  ·  view source on GitHub ↗
(object)

Source from the content-addressed store, hash-verified

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 `

Callers 1

renderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected