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/partials/transformConstraints.ts
Alex Sánchez 02fa3363f5
Constraints translation (#142)
* constraints translation

* fix lint

* fixes

* fix vector constraints

* fix lint
2024-06-06 12:17:17 +02:00

12 lines
425 B
TypeScript

import { translateConstraintH, translateConstraintV } from '@plugin/translators';
import { ShapeAttributes } from '@ui/lib/types/shapes/shape';
export const transformConstraints = (
node: ConstraintMixin
): Pick<ShapeAttributes, 'constraintsH' | 'constraintsV'> => {
return {
constraintsH: translateConstraintH(node.constraints.horizontal),
constraintsV: translateConstraintV(node.constraints.vertical)
};
};