File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -337,14 +337,17 @@ const selectablePaths = Object.fromEntries(
337337) ;
338338
339339const generateShapeSVG = ( shapeObj ) => {
340+ if ( shapeObj . _cachedSVG ) return shapeObj . _cachedSVG ;
341+
340342 const strokeColor = "#575e75" ;
341343 const path = new paper . Path ( shapeObj . path ) ;
342344 const bounds = path . getBounds ( ) ;
343345 const viewbox = `${ bounds . x } ${ bounds . y } ${ bounds . width } ${ bounds . height } ` ;
344346 path . remove ( ) ;
345347
346- return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${ viewbox } ">`
347- + `<path d="${ shapeObj . path } " stroke-width="${ bounds . width / bounds . height } " stroke="${ strokeColor } " fill="none"/></svg>` ;
348+ shapeObj . _cachedSVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${ viewbox } ">`
349+ + `<path d="${ shapeObj . path } " stroke-width="${ window . test ?? 1 } " stroke="${ strokeColor } " fill="none"/></svg>` ;
350+ return shapeObj . _cachedSVG ;
348351} ;
349352
350353export {
You can’t perform that action at this time.
0 commit comments