0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 05:33:02 -05:00
This commit is contained in:
Alex Sánchez 2024-04-15 15:47:41 +02:00
parent 48a80a702d
commit 2869673f9c
No known key found for this signature in database
GPG key ID: 68A95170EEB87E16
4 changed files with 12 additions and 5 deletions

View file

@ -1,5 +1,5 @@
import { transformDimensionAndPosition } from '@plugin/transformers/partials';
import { translateFills } from '@plugin/translators';
import { translateBlendMode, translateFills } from '@plugin/translators';
import { CircleShape } from '@ui/lib/types/circle/circleShape';
@ -12,6 +12,8 @@ export const transformEllipseNode = (
type: 'circle',
name: node.name,
fills: translateFills(node.fills, node.width, node.height),
blendMode: translateBlendMode(node.blendMode),
opacity: !node.visible ? 0 : node.opacity, //@TODO: check this. If we use the property hidden and it's hidden, it won't export
...transformDimensionAndPosition(node, baseX, baseY)
};
};

View file

@ -2,12 +2,16 @@ import { PenpotFile } from '@ui/lib/penpot';
import { CIRCLE_TYPE } from '@ui/lib/types/circle/circleAttributes';
import { CircleShape } from '@ui/lib/types/circle/circleShape';
import { translateFillGradients } from '../translators';
import { translateFillGradients, translateUiBlendMode } from '../translators';
export const createPenpotCircle = (file: PenpotFile, { type, fills, ...rest }: CircleShape) => {
export const createPenpotCircle = (
file: PenpotFile,
{ type, fills, blendMode, ...rest }: CircleShape
) => {
file.createCircle({
type: CIRCLE_TYPE,
fills: translateFillGradients(fills),
blendMode: translateUiBlendMode(blendMode),
...rest
});
};

View file

@ -5,7 +5,6 @@ import { translateFillGradients, translateUiBlendMode } from '@ui/translators';
export const createPenpotRectangle = (
file: PenpotFile,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
{ type, fills, blendMode, ...rest }: RectShape
) => {
file.createRect({

View file

@ -1,3 +1,4 @@
import { LayoutChildAttributes } from '@ui/lib/types/layout/layoutChildAttributes';
import { ShapeAttributes } from '@ui/lib/types/shape/shapeAttributes';
import { ShapeBaseAttributes } from '@ui/lib/types/shape/shapeBaseAttributes';
import { ShapeGeomAttributes } from '@ui/lib/types/shape/shapeGeomAttributes';
@ -7,4 +8,5 @@ import { CircleAttributes } from './circleAttributes';
export type CircleShape = ShapeBaseAttributes &
ShapeGeomAttributes &
ShapeAttributes &
CircleAttributes;
CircleAttributes &
LayoutChildAttributes;