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/plugin-src/transformers/transformTextNode.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

33 lines
886 B
TypeScript

import {
transformBlend,
transformConstraints,
transformDimension,
transformEffects,
transformFigmaIds,
transformLayoutAttributes,
transformProportion,
transformRotationAndPosition,
transformSceneNode,
transformStrokes,
transformText
} from '@plugin/transformers/partials';
import { TextShape } from '@ui/lib/types/shapes/textShape';
export const transformTextNode = (node: TextNode, baseRotation: number): TextShape => {
return {
type: 'text',
name: node.name,
...transformFigmaIds(node),
...transformText(node),
...transformDimension(node),
...transformRotationAndPosition(node, baseRotation),
...transformEffects(node),
...transformSceneNode(node),
...transformBlend(node),
...transformProportion(node),
...transformLayoutAttributes(node),
...transformStrokes(node),
...transformConstraints(node)
};
};