From cd2125cccbe9627cff4439181bb3a91249b136bf Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Tue, 15 May 2018 14:24:52 -0700 Subject: [PATCH] fixes #687 --- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index bd2a4c45..02a8ddad 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -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: