mathandy / svgpathtools

A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves.
MIT License
532 stars 134 forks source link

baseunit ignored in disvg when viewbox parameter is provided #215

Open maria-korosteleva opened 9 months ago

maria-korosteleva commented 9 months ago

I'm trying to save my list of paths to svg using 'cm' as units. I call disvg with viewport and baseunit parameters set (but not dimentions). The baseunit value is ignored and svg is created in px instead of cm.

It seems like the bug is in this expression, which needs to include baseunit parameter into the dimensions definition: https://github.com/mathandy/svgpathtools/blob/fcb648b9bb9591d925876d3b51649fa175b40524/svgpathtools/paths2svg.py#L266