mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-05 06:10:52 -05:00
24 lines
411 B
TypeScript
24 lines
411 B
TypeScript
|
export const translateLineNode = (node: LineNode): VectorPaths => {
|
||
|
const commands = [
|
||
|
{
|
||
|
command: 'moveto',
|
||
|
code: 'M',
|
||
|
x: 0,
|
||
|
y: 0
|
||
|
},
|
||
|
{
|
||
|
command: 'lineto',
|
||
|
code: 'L',
|
||
|
x: node.width,
|
||
|
y: node.height
|
||
|
}
|
||
|
];
|
||
|
|
||
|
return [
|
||
|
{
|
||
|
windingRule: 'NONE',
|
||
|
data: commands.reduce((acc, { code, x, y }) => acc + `${code} ${x} ${y}`, '')
|
||
|
}
|
||
|
];
|
||
|
};
|