0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-10 09:00:08 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformRectangleNode.ts

20 lines
604 B
TypeScript
Raw Normal View History

2024-04-15 06:58:51 -05:00
import { transformDimensionAndPosition } from '@plugin/transformers/partials';
2024-04-15 07:03:30 -05:00
import { translateBlendMode, translateFills } from '@plugin/translators';
import { RectShape } from '@ui/lib/types/rect/rectShape';
export const transformRectangleNode = (
node: RectangleNode,
baseX: number,
baseY: number
): RectShape => {
return {
type: 'rect',
name: node.name,
2024-04-15 07:03:30 -05:00
fills: translateFills(node.fills, node.width, node.height),
2024-04-15 07:06:23 -05:00
blendMode: translateBlendMode(node.blendMode),
2024-04-15 07:12:33 -05:00
opacity: !node.visible ? 0 : node.opacity,
2024-04-15 06:58:51 -05:00
...transformDimensionAndPosition(node, baseX, baseY)
};
};