From 55d9e8888b77c50a1ba568c9dd3153f5f288976f Mon Sep 17 00:00:00 2001 From: Kenneth Lyons Date: Tue, 25 Jun 2019 16:08:18 -0700 Subject: [PATCH] Allow last image in stack to be selected by slider in ImageView --- pyqtgraph/imageview/ImageView.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/imageview/ImageView.py b/pyqtgraph/imageview/ImageView.py index 81463b7a..512d503b 100644 --- a/pyqtgraph/imageview/ImageView.py +++ b/pyqtgraph/imageview/ImageView.py @@ -740,7 +740,7 @@ class ImageView(QtGui.QWidget): return (0,0) t = slider.value() - + xv = self.tVals if xv is None: ind = int(t) @@ -748,7 +748,7 @@ class ImageView(QtGui.QWidget): if len(xv) < 2: return (0,0) totTime = xv[-1] + (xv[-1]-xv[-2]) - inds = np.argwhere(xv < t) + inds = np.argwhere(xv <= t) if len(inds) < 1: return (0,t) ind = inds[-1,0]