0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-05 06:10:52 -05:00
penpot-exporter-figma-plugin/plugin-src/translators/vectors/translateLineNode.ts

24 lines
411 B
TypeScript
Raw Permalink Normal View History

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}`, '')
}
];
};