Closed frakie-com closed 4 years ago
When using "dots" for filling with rough.js in SVG, the generated SVG paths have unbounded decimal precission, thus generating very (too) long SVG path definitions, for example:
<path d="M30.539315825403072 38.8454317562159 C31.883007943372455 38.55777292462577, 37.10578534198741 39.022739438608504, 37.7268100198641
This is usually innecessary, because with 2 or 3 decimal digits would be more than enough, AND this reduces the generated SVG size 3-fold or more.
It's easy as adding a "round" function before outputting the numbers, which I have done in src/generator.ts.
Also added a "Precision" option, with default=3 (could be 2).
You can play a bit with our updated version in our On-line digital art gallery
When using "dots" for filling with rough.js in SVG, the generated SVG paths have unbounded decimal precission, thus generating very (too) long SVG path definitions, for example:
This is usually innecessary, because with 2 or 3 decimal digits would be more than enough, AND this reduces the generated SVG size 3-fold or more.
It's easy as adding a "round" function before outputting the numbers, which I have done in src/generator.ts.
Also added a "Precision" option, with default=3 (could be 2).
You can play a bit with our updated version in our On-line digital art gallery