mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-03 13:20:37 -05:00
af81fc7e92
* Implement rotation for vector lines * wip * Improve rotations for lines * add changelog * add layout attributes to line
19 lines
443 B
TypeScript
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;
|
|
};
|