diff --git a/.changeset/flat-balloons-exercise.md b/.changeset/flat-balloons-exercise.md deleted file mode 100644 index 553dc29b..00000000 --- a/.changeset/flat-balloons-exercise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"penpot-exporter": minor ---- - -Shadows diff --git a/.changeset/many-otters-mix.md b/.changeset/many-otters-mix.md new file mode 100644 index 00000000..2940460f --- /dev/null +++ b/.changeset/many-otters-mix.md @@ -0,0 +1,5 @@ +--- +"penpot-exporter": patch +--- + +Fix vector shapes to be more precise with what you draw on figma diff --git a/.changeset/perfect-masks-kneel.md b/.changeset/perfect-masks-kneel.md deleted file mode 100644 index fcfaabae..00000000 --- a/.changeset/perfect-masks-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"penpot-exporter": minor ---- - -Added support for corner radius diff --git a/CHANGELOG.md b/CHANGELOG.md index 560fd22e..48068315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # penpot-exporter +## 0.2.1 + +### Patch Changes + +- [#71](https://github.com/penpot/penpot-exporter-figma-plugin/pull/71) [`3dec0a4`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/3dec0a452079e1a1a3e64290e16b881a47a22876) Thanks [@Cenadros](https://github.com/Cenadros)! - Fix blend mode 'color' translation + +## 0.2.0 + +### Minor Changes + +- [#58](https://github.com/penpot/penpot-exporter-figma-plugin/pull/58) [`e732887`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/e73288739987d67135dc20ebb97fd165b3da0c79) Thanks [@jordisala1991](https://github.com/jordisala1991)! - Shadows + +- [#57](https://github.com/penpot/penpot-exporter-figma-plugin/pull/57) [`c464ff9`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/c464ff9bda24ef1660f2a58ecb39f76f1e8151a8) Thanks [@Cenadros](https://github.com/Cenadros)! - Added support for corner radius + +### Patch Changes + +- [#68](https://github.com/penpot/penpot-exporter-figma-plugin/pull/68) [`92e0b6f`](https://github.com/penpot/penpot-exporter-figma-plugin/commit/92e0b6f026c8f05d1581bd6d3774e20f6992cb92) Thanks [@Cenadros](https://github.com/Cenadros)! - Fixed strokecaps for arrows that were showing even when not configured in figma + ## 0.1.0 ### Minor Changes diff --git a/package.json b/package.json index 5a410b56..d4c044e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "penpot-exporter", - "version": "0.1.0", + "version": "0.2.1", "description": "Penpot exporter", "type": "module", "scripts": { diff --git a/plugin-src/transformers/partials/transformVectorPaths.ts b/plugin-src/transformers/partials/transformVectorPaths.ts index 931887a3..64bdeb5e 100644 --- a/plugin-src/transformers/partials/transformVectorPaths.ts +++ b/plugin-src/transformers/partials/transformVectorPaths.ts @@ -2,17 +2,13 @@ import { translateVectorPaths } from '@plugin/translators'; import { PathAttributes } from '@ui/lib/types/path/pathAttributes'; -const hasFillGeometry = (node: VectorNode | StarNode | LineNode | PolygonNode): boolean => { - return 'fillGeometry' in node && node.fillGeometry.length > 0; -}; - const getVectorPaths = (node: VectorNode | StarNode | LineNode | PolygonNode): VectorPaths => { switch (node.type) { case 'STAR': case 'POLYGON': return node.fillGeometry; case 'VECTOR': - return hasFillGeometry(node) ? node.fillGeometry : node.vectorPaths; + return node.vectorPaths; case 'LINE': return node.strokeGeometry; } diff --git a/plugin-src/translators/translateStrokes.ts b/plugin-src/translators/translateStrokes.ts index e380213d..14df601f 100644 --- a/plugin-src/translators/translateStrokes.ts +++ b/plugin-src/translators/translateStrokes.ts @@ -18,7 +18,7 @@ export const translateStrokes = ( strokeStyle: nodeStrokes.dashPattern.length ? 'dashed' : 'solid' }; - if (!hasFillGeometry && index === 0 && vectorNetwork && vectorNetwork.vertices.length) { + if (!hasFillGeometry && index === 0 && vectorNetwork && vectorNetwork.vertices.length > 0) { stroke.strokeCapStart = translateStrokeCap(vectorNetwork.vertices[0]); stroke.strokeCapEnd = translateStrokeCap( vectorNetwork.vertices[vectorNetwork.vertices.length - 1] @@ -64,8 +64,6 @@ const translateStrokeAlignment = ( const translateStrokeCap = (vertex: VectorVertex): StrokeCaps | undefined => { switch (vertex.strokeCap as StrokeCap | ConnectorStrokeCap) { - case 'NONE': - return; case 'ROUND': return 'round'; case 'ARROW_EQUILATERAL': @@ -78,7 +76,9 @@ const translateStrokeCap = (vertex: VectorVertex): StrokeCaps | undefined => { case 'DIAMOND_FILLED': return 'diamond-marker'; case 'ARROW_LINES': - default: return 'line-arrow'; + case 'NONE': + default: + return; } }; diff --git a/ui-src/translators/translateUiBlendMode.ts b/ui-src/translators/translateUiBlendMode.ts index 0d45cf06..6c7939fc 100644 --- a/ui-src/translators/translateUiBlendMode.ts +++ b/ui-src/translators/translateUiBlendMode.ts @@ -1,4 +1,5 @@ import { + BLEND_MODE_COLOR, BLEND_MODE_COLOR_BURN, BLEND_MODE_COLOR_DODGE, BLEND_MODE_DARKEN, @@ -50,7 +51,7 @@ export const translateUiBlendMode = (blendMode?: BlendMode): BlendMode | undefin case 'saturation': return BLEND_MODE_SATURATION; case 'color': - return BLEND_MODE_COLOR_BURN; + return BLEND_MODE_COLOR; case 'luminosity': return BLEND_MODE_LUMINOSITY; default: