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';
|
2024-04-12 09:52:36 -05:00
|
|
|
|
|
|
|
import { RectShape } from '@ui/lib/types/rect/rectShape';
|
2024-04-12 06:55:42 -05:00
|
|
|
|
|
|
|
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)
|
2024-04-12 06:55:42 -05:00
|
|
|
};
|
|
|
|
};
|