mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-31 12:03:58 -05:00
circle
This commit is contained in:
parent
48a80a702d
commit
2869673f9c
4 changed files with 12 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { transformDimensionAndPosition } from '@plugin/transformers/partials';
|
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';
|
import { CircleShape } from '@ui/lib/types/circle/circleShape';
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@ export const transformEllipseNode = (
|
||||||
type: 'circle',
|
type: 'circle',
|
||||||
name: node.name,
|
name: node.name,
|
||||||
fills: translateFills(node.fills, node.width, node.height),
|
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)
|
...transformDimensionAndPosition(node, baseX, baseY)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,12 +2,16 @@ import { PenpotFile } from '@ui/lib/penpot';
|
||||||
import { CIRCLE_TYPE } from '@ui/lib/types/circle/circleAttributes';
|
import { CIRCLE_TYPE } from '@ui/lib/types/circle/circleAttributes';
|
||||||
import { CircleShape } from '@ui/lib/types/circle/circleShape';
|
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({
|
file.createCircle({
|
||||||
type: CIRCLE_TYPE,
|
type: CIRCLE_TYPE,
|
||||||
fills: translateFillGradients(fills),
|
fills: translateFillGradients(fills),
|
||||||
|
blendMode: translateUiBlendMode(blendMode),
|
||||||
...rest
|
...rest
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { translateFillGradients, translateUiBlendMode } from '@ui/translators';
|
||||||
|
|
||||||
export const createPenpotRectangle = (
|
export const createPenpotRectangle = (
|
||||||
file: PenpotFile,
|
file: PenpotFile,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
{ type, fills, blendMode, ...rest }: RectShape
|
{ type, fills, blendMode, ...rest }: RectShape
|
||||||
) => {
|
) => {
|
||||||
file.createRect({
|
file.createRect({
|
||||||
|
|
4
ui-src/lib/types/circle/circleShape.d.ts
vendored
4
ui-src/lib/types/circle/circleShape.d.ts
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
import { LayoutChildAttributes } from '@ui/lib/types/layout/layoutChildAttributes';
|
||||||
import { ShapeAttributes } from '@ui/lib/types/shape/shapeAttributes';
|
import { ShapeAttributes } from '@ui/lib/types/shape/shapeAttributes';
|
||||||
import { ShapeBaseAttributes } from '@ui/lib/types/shape/shapeBaseAttributes';
|
import { ShapeBaseAttributes } from '@ui/lib/types/shape/shapeBaseAttributes';
|
||||||
import { ShapeGeomAttributes } from '@ui/lib/types/shape/shapeGeomAttributes';
|
import { ShapeGeomAttributes } from '@ui/lib/types/shape/shapeGeomAttributes';
|
||||||
|
@ -7,4 +8,5 @@ import { CircleAttributes } from './circleAttributes';
|
||||||
export type CircleShape = ShapeBaseAttributes &
|
export type CircleShape = ShapeBaseAttributes &
|
||||||
ShapeGeomAttributes &
|
ShapeGeomAttributes &
|
||||||
ShapeAttributes &
|
ShapeAttributes &
|
||||||
CircleAttributes;
|
CircleAttributes &
|
||||||
|
LayoutChildAttributes;
|
||||||
|
|
Loading…
Reference in a new issue