0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-03 13:20:37 -05:00
penpot-exporter-figma-plugin/plugin-src/translators/vectors/translateVectorPaths.ts
Jordi Sala Morales af81fc7e92
Implement rotation for vector lines (#160)
* Implement rotation for vector lines

* wip

* Improve rotations for lines

* add changelog

* add layout attributes to line
2024-06-14 10:33:23 +02:00

19 lines
443 B
TypeScript

import { parseSVG } from 'svg-path-parser';
import { Segment } from '@ui/lib/types/shapes/pathShape';
import { translateCommandsToSegments } from '.';
export const translateVectorPaths = (
paths: VectorPaths,
baseX: number,
baseY: number
): Segment[] => {
const segments: Segment[] = [];
for (const path of paths) {
segments.push(...translateCommandsToSegments(parseSVG(path.data), baseX, baseY));
}
return segments;
};