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:
parent
65a06d761c
commit
c95d442e74
2 changed files with 10 additions and 7 deletions
5
.changeset/lemon-jars-think.md
Normal file
5
.changeset/lemon-jars-think.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'penpot-exporter': patch
|
||||
---
|
||||
|
||||
Fixed issue where big vectors are making the plugin crash
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue