fixed issue with parameter being ignored

pull/75/head
Andy Port 2018-10-13 20:36:01 -07:00
parent 7fa103e533
commit 95179a6bfa
1 changed files with 6 additions and 5 deletions

View File

@ -140,8 +140,8 @@ def disvg(paths=None, colors=None,
:param mindim - The minimum dimension (height or width) of the output :param mindim - The minimum dimension (height or width) of the output
SVG (default is 600). SVG (default is 600).
:param dimensions - The display dimensions of the output SVG. Using :param dimensions - The (x,y) display dimensions of the output SVG.
this will override the mindim parameter. Using this will override the `mindim` parameter.
:param viewbox - This specifies what rectangular patch of R^2 will be :param viewbox - This specifies what rectangular patch of R^2 will be
viewable through the outputSVG. It should be input as a 4-tuple, viewable through the outputSVG. It should be input as a 4-tuple,
@ -230,11 +230,12 @@ def disvg(paths=None, colors=None,
assert paths or nodes assert paths or nodes
stuff2bound = [] stuff2bound = []
if viewbox: if viewbox:
if isinstance(viewbox, str): if not isinstance(viewbox, str):
viewbox = '%s %s %s %s' % viewbox
if dimensions is None:
szx, szy = viewbox.split(' ')[2:4] szx, szy = viewbox.split(' ')[2:4]
else: else:
szx, szy = viewbox[2:4] szx, szy = dimensions
viewbox = '%s %s %s %s' % viewbox
else: else:
if paths: if paths:
stuff2bound += paths stuff2bound += paths