Merge pull request #689 from campagnola/viewbox-fix

ViewBox fix: don't call setRange with empty args
This commit is contained in:
Luke Campagnola 2018-05-16 08:36:51 -07:00 committed by GitHub
commit 0b0e601bd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -847,10 +847,6 @@ class ViewBox(GraphicsWidget):
childRange[ax][1] += wp
targetRect[ax] = childRange[ax]
args['xRange' if ax == 0 else 'yRange'] = targetRect[ax]
if len(args) == 0:
return
args['padding'] = 0
args['disableAutoRange'] = False
# check for and ignore bad ranges
for k in ['xRange', 'yRange']:
@ -858,6 +854,11 @@ class ViewBox(GraphicsWidget):
if not np.all(np.isfinite(args[k])):
r = args.pop(k)
#print("Warning: %s is invalid: %s" % (k, str(r))
if len(args) == 0:
return
args['padding'] = 0
args['disableAutoRange'] = False
self.setRange(**args)
finally: