UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

1 lines 901 B
{"version":3,"file":"svgExport.mjs","sources":["../../../../src/util/misc/svgExport.ts"],"sourcesContent":["import type { TMat2D } from '../../typedefs';\nimport { toFixed } from './toFixed';\nimport { config } from '../../config';\n\n/**\n * given an array of 6 number returns something like `\"matrix(...numbers)\"`\n * @param {TMat2D} transform an array with 6 numbers\n * @return {String} transform matrix for svg\n */\nexport const matrixToSVG = (transform: TMat2D) =>\n 'matrix(' +\n transform\n .map((value) => toFixed(value, config.NUM_FRACTION_DIGITS))\n .join(' ') +\n ')';\n"],"names":["matrixToSVG","transform","map","value","toFixed","config","NUM_FRACTION_DIGITS","join"],"mappings":";;;AAIA;AACA;AACA;AACA;AACA;AACaA,MAAAA,WAAW,GAAIC,SAAiB,IAC3C,SAAS,GACTA,SAAS,CACNC,GAAG,CAAEC,KAAK,IAAKC,OAAO,CAACD,KAAK,EAAEE,MAAM,CAACC,mBAAmB,CAAC,CAAC,CAC1DC,IAAI,CAAC,GAAG,CAAC,GACZ;;;;"}