now `dimensions` parameter supports units will specify `viewbox` if not given

pull/75/head
Andy Port 2018-10-13 22:22:52 -07:00
parent aa03a4aecb
commit ee8eda5aae
1 changed files with 1 additions and 1 deletions

View File

@ -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: