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/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; }