2024-04-15 11:58:51 +00:00
|
|
|
import { transformDimensionAndPosition } from '@plugin/transformers/partials';
|
2024-04-15 14:03:30 +02:00
|
|
|
import { translateBlendMode, translateFills } from '@plugin/translators';
|
2024-04-12 16:52:36 +02:00
|
|
|
|
|
|
|
import { RectShape } from '@ui/lib/types/rect/rectShape';
|
2024-04-12 13:55:42 +02:00
|
|
|
|
|
|
|
export const transformRectangleNode = (
|
|
|
|
node: RectangleNode,
|
|
|
|
baseX: number,
|
|
|
|
baseY: number
|
|
|
|
): RectShape => {
|
|
|
|
return {
|
|
|
|
type: 'rect',
|
|
|
|
name: node.name,
|
2024-04-15 14:03:30 +02:00
|
|
|
fills: translateFills(node.fills, node.width, node.height),
|
2024-04-15 14:06:23 +02:00
|
|
|
blendMode: translateBlendMode(node.blendMode),
|
2024-04-15 14:17:22 +02:00
|
|
|
opacity: !node.visible ? 0 : node.opacity, //@TODO: check this. If we use the property hidden and it's hidden, it won't export
|
2024-04-15 11:58:51 +00:00
|
|
|
...transformDimensionAndPosition(node, baseX, baseY)
|
2024-04-12 13:55:42 +02:00
|
|
|
};
|
|
|
|
};
|