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/partials/transformDimensionAndPosition.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

21 lines
507 B
TypeScript

import { ShapeGeomAttributes } from '@ui/lib/types/shapes/shape';
export const transformDimension = (
node: DimensionAndPositionMixin
): Pick<ShapeGeomAttributes, 'width' | 'height'> => {
return {
width: node.width,
height: node.height
};
};
export const transformDimensionAndPosition = (
node: DimensionAndPositionMixin
): ShapeGeomAttributes => {
return {
x: node.absoluteTransform[0][2],
y: node.absoluteTransform[1][2],
width: node.width,
height: node.height
};
};