Sometimes svg.js produces unrounded values like x="2.999999999999" or similar which can take a bunch if space in your database when you save them. It also slows down the browser.
Thats why we want to introduce rounding of nodes.
As wout suggested this will work like the following examples:
var svg = path.round(2).svg()Or non-destructively:
var clone = path.clone().round(3) var svg = clone.svg() clone.remove()We can also provide deep rounding for elements inheriting from SVG.Parent. Something like:
nested.round(2, true)
Note: Implementation has to be done on the 3.0 branch
For all questions head over to our gitter chat: https://gitter.im/svgdotjs/svg.js
I'll work on this
Feel free to jump on gitter if you need help with anything :)
This was implemented in the latest commit
Most helpful comment
I'll work on this