From ee8eda5aaeec3f1ee46df6c5047120d80a1105dc Mon Sep 17 00:00:00 2001 From: Andy Port Date: Sat, 13 Oct 2018 22:22:52 -0700 Subject: [PATCH] now `dimensions` parameter supports units will specify `viewbox` if not given --- svgpathtools/paths2svg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svgpathtools/paths2svg.py b/svgpathtools/paths2svg.py index e5b8a81..e350265 100644 --- a/svgpathtools/paths2svg.py +++ b/svgpathtools/paths2svg.py @@ -243,7 +243,7 @@ def disvg(paths=None, colors=None, elif dimensions: dimensions = tuple(map(str, dimensions)) def strip_units(s): - return re.search('\d?\.?\d?', s).group() + return re.search(r'\d*\.?\d*', s.strip()).group() viewbox = '0 0 %s %s' % tuple(map(strip_units, dimensions)) else: if paths: