0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-20 14:32:31 -05:00
penpot-exporter-figma-plugin/ui-src/parser/creators/createCircle.ts

23 lines
741 B
TypeScript
Raw Normal View History

2024-05-13 10:12:58 +02:00
import { PenpotFile } from '@ui/lib/types/penpotFile';
2024-05-06 08:06:14 +02:00
import { CircleShape } from '@ui/lib/types/shapes/circleShape';
import { parseFigmaId } from '@ui/parser';
import { symbolFills, symbolStrokes, symbolTouched } from '@ui/parser/creators/symbols';
2024-04-12 18:52:19 +02:00
export const createCircle = (
2024-04-15 15:47:41 +02:00
file: PenpotFile,
{ type, figmaId, figmaRelatedId, ...shape }: CircleShape
2024-04-15 15:47:41 +02:00
) => {
shape.id = parseFigmaId(file, figmaId);
shape.shapeRef = parseFigmaId(file, figmaRelatedId, true);
shape.fills = symbolFills(shape.fillStyleId, shape.fills);
shape.strokes = symbolStrokes(shape.strokes);
shape.touched = symbolTouched(
!shape.hidden,
undefined,
shape.touched,
shape.componentPropertyReferences
);
file.createCircle(shape);
2024-04-08 17:50:01 +02:00
};