0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 13:43:03 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformPathNode.ts
Jordi Sala Morales e5f2943532
Implement rotation for frames and sections (#163)
* Implement rotation for frames and sections

* wip

* finish implementation

* add changelog
2024-06-14 16:28:01 +02:00

34 lines
881 B
TypeScript

import {
transformBlend,
transformConstraints,
transformEffects,
transformFigmaIds,
transformFills,
transformLayoutAttributes,
transformProportion,
transformSceneNode,
transformStrokes
} from '@plugin/transformers/partials';
import { translatePathNode } from '@plugin/translators/vectors';
import { PathShape } from '@ui/lib/types/shapes/pathShape';
export const transformPathNode = (
node: StarNode | PolygonNode,
baseRotation: number
): PathShape => {
return {
type: 'path',
name: node.name,
content: translatePathNode(node, baseRotation),
...transformFigmaIds(node),
...transformFills(node),
...transformStrokes(node),
...transformEffects(node),
...transformSceneNode(node),
...transformBlend(node),
...transformProportion(node),
...transformLayoutAttributes(node),
...transformConstraints(node)
};
};