mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-31 12:03:58 -05:00
e5f2943532
* Implement rotation for frames and sections * wip * finish implementation * add changelog
37 lines
959 B
TypeScript
37 lines
959 B
TypeScript
import {
|
|
transformBlend,
|
|
transformDimension,
|
|
transformEffects,
|
|
transformFigmaIds,
|
|
transformRotationAndPosition,
|
|
transformSceneNode
|
|
} from '@plugin/transformers/partials';
|
|
import { transformChildren } from '@plugin/transformers/partials';
|
|
|
|
import { GroupShape } from '@ui/lib/types/shapes/groupShape';
|
|
|
|
export const transformGroupNode = async (
|
|
node: GroupNode,
|
|
baseRotation: number
|
|
): Promise<GroupShape> => {
|
|
return {
|
|
...transformFigmaIds(node),
|
|
...transformGroupNodeLike(node, baseRotation),
|
|
...transformEffects(node),
|
|
...transformBlend(node),
|
|
...(await transformChildren(node, baseRotation))
|
|
};
|
|
};
|
|
|
|
export const transformGroupNodeLike = (
|
|
node: BaseNodeMixin & LayoutMixin & SceneNodeMixin,
|
|
baseRotation: number
|
|
): GroupShape => {
|
|
return {
|
|
type: 'group',
|
|
name: node.name,
|
|
...transformDimension(node),
|
|
...transformRotationAndPosition(node, baseRotation),
|
|
...transformSceneNode(node)
|
|
};
|
|
};
|