diff --git a/.changeset/lemon-jars-think.md b/.changeset/lemon-jars-think.md new file mode 100644 index 00000000..df4f01c3 --- /dev/null +++ b/.changeset/lemon-jars-think.md @@ -0,0 +1,5 @@ +--- +'penpot-exporter': patch +--- + +Fixed issue where big vectors are making the plugin crash diff --git a/plugin-src/transformers/partials/transformVectorPaths.ts b/plugin-src/transformers/partials/transformVectorPaths.ts index 448d4994..f02e3b50 100644 --- a/plugin-src/transformers/partials/transformVectorPaths.ts +++ b/plugin-src/transformers/partials/transformVectorPaths.ts @@ -14,16 +14,14 @@ import { translateCommands, translateWindingRule } from '@plugin/translators/vec import { PathShape } from '@ui/lib/types/shapes/pathShape'; export const transformVectorPaths = (node: VectorNode): PathShape[] => { + const regions = node.vectorNetwork?.regions ?? []; + const strokeLength = node.strokes.length; + const pathShapes = node.vectorPaths .filter((vectorPath, index) => { - return ( - nodeHasFills(node, vectorPath, (node.vectorNetwork.regions ?? [])[index]) || - node.strokes.length > 0 - ); + return nodeHasFills(node, vectorPath, regions[index]) || strokeLength > 0; }) - .map((vectorPath, index) => - transformVectorPath(node, vectorPath, (node.vectorNetwork.regions ?? [])[index]) - ); + .map((vectorPath, index) => transformVectorPath(node, vectorPath, regions[index])); const geometryShapes = node.fillGeometry .filter(