mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-08 16:10:07 -05:00
73ccf83657
* path shapes * add polygon node * wip vector * implement translation of commands and paths * vectors and polygon * strokes * star * deformed shapes * simplify star * simplify star * fix transformers --------- Co-authored-by: Alex Sánchez <sion333@gmail.com>
25 lines
755 B
TypeScript
25 lines
755 B
TypeScript
import {
|
|
transformBlend,
|
|
transformDimensionAndPosition,
|
|
transformSceneNode
|
|
} from '@plugin/transformers/partials';
|
|
import { translateFills, translateStrokes, translateVectorPaths } from '@plugin/translators';
|
|
|
|
import { PathShape } from '@ui/lib/types/path/pathShape';
|
|
|
|
export const transformPolygonNode = (
|
|
node: DefaultShapeMixin,
|
|
baseX: number,
|
|
baseY: number
|
|
): PathShape => {
|
|
return {
|
|
type: 'path',
|
|
name: node.name,
|
|
content: translateVectorPaths(node.fillGeometry, baseX + node.x, baseY + node.y),
|
|
strokes: translateStrokes(node),
|
|
fills: translateFills(node.fills, node.width, node.height),
|
|
...transformDimensionAndPosition(node, baseX, baseY),
|
|
...transformSceneNode(node),
|
|
...transformBlend(node)
|
|
};
|
|
};
|