now `dimensions` parameter supports units will specify `viewbox` if not given
parent
aa03a4aecb
commit
ee8eda5aae
|
@ -243,7 +243,7 @@ def disvg(paths=None, colors=None,
|
||||||
elif dimensions:
|
elif dimensions:
|
||||||
dimensions = tuple(map(str, dimensions))
|
dimensions = tuple(map(str, dimensions))
|
||||||
def strip_units(s):
|
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))
|
viewbox = '0 0 %s %s' % tuple(map(strip_units, dimensions))
|
||||||
else:
|
else:
|
||||||
if paths:
|
if paths:
|
||||||
|
|
Loading…
Reference in New Issue