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/translateVectorPaths.ts

20 lines
443 B
TypeScript
Raw Normal View History

import { parseSVG } from 'svg-path-parser';
2024-05-06 01:06:14 -05:00
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;
};