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

22 lines
507 B
TypeScript
Raw Normal View History

2024-05-06 01:06:14 -05:00
import { ShapeGeomAttributes } from '@ui/lib/types/shapes/shape';
2024-04-15 06:58:51 -05:00
export const transformDimension = (
node: DimensionAndPositionMixin
): Pick<ShapeGeomAttributes, 'width' | 'height'> => {
return {
width: node.width,
height: node.height
};
};
2024-04-15 06:58:51 -05:00
export const transformDimensionAndPosition = (
node: DimensionAndPositionMixin
2024-04-15 06:58:51 -05:00
): ShapeGeomAttributes => {
return {
x: node.absoluteTransform[0][2],
y: node.absoluteTransform[1][2],
2024-04-15 06:58:51 -05:00
width: node.width,
height: node.height
};
};