From 59d70d251094895b18bd6af7a8818a0b1de6abf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Fri, 26 Apr 2024 17:09:57 +0200 Subject: [PATCH] Fix vector shapes to be more precise with what you draw on figma (#76) * draft * Add changelog --------- Co-authored-by: Jordi Sala Morales --- .changeset/many-otters-mix.md | 5 +++++ plugin-src/transformers/partials/transformVectorPaths.ts | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .changeset/many-otters-mix.md diff --git a/.changeset/many-otters-mix.md b/.changeset/many-otters-mix.md new file mode 100644 index 0000000..2940460 --- /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/plugin-src/transformers/partials/transformVectorPaths.ts b/plugin-src/transformers/partials/transformVectorPaths.ts index 931887a..64bdeb5 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; }