0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-21 21:23:06 -05:00

Fix for huge vectors crashing the plugin (#220)

* fixed big vectors issue

* fixes
This commit is contained in:
Alex Sánchez 2024-09-20 09:02:30 +02:00 committed by GitHub
parent 65a06d761c
commit c95d442e74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View file

@ -0,0 +1,5 @@
---
'penpot-exporter': patch
---
Fixed issue where big vectors are making the plugin crash

View file

@ -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(