0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 21:53:27 -05:00
penpot-exporter-figma-plugin/ui-src/parser/creators/createRectangle.ts

17 lines
592 B
TypeScript
Raw Normal View History

2024-05-13 03:12:58 -05:00
import { PenpotFile } from '@ui/lib/types/penpotFile';
2024-05-06 01:06:14 -05:00
import { RectShape } from '@ui/lib/types/shapes/rectShape';
import { parseFigmaId } from '@ui/parser';
import { symbolFills, symbolStrokes } from '@ui/parser/creators/symbols';
2024-04-08 10:50:01 -05:00
export const createRectangle = (
2024-04-15 07:03:30 -05:00
file: PenpotFile,
{ type, figmaId, figmaRelatedId, ...shape }: RectShape
2024-04-15 07:03:30 -05:00
) => {
shape.id = parseFigmaId(file, figmaId);
shape.shapeRef = parseFigmaId(file, figmaRelatedId, true);
shape.fills = symbolFills(shape.fillStyleId, shape.fills);
shape.strokes = symbolStrokes(shape.strokes);
file.createRect(shape);
2024-04-08 10:50:01 -05:00
};