Skip to content

Commit 5203368

Browse files
committed
fix: Update order of indices on mouseclick
1 parent 47ea032 commit 5203368

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nibabel/viewers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,11 @@ def _on_mouse(self, event):
492492
x, y = event.xdata, event.ydata
493493
x = self._sizes[xax] - x if self._flips[xax] else x
494494
y = self._sizes[yax] - y if self._flips[yax] else y
495-
idxs = [None, None, None, 1.0]
495+
idxs = np.ones(4)
496496
idxs[xax] = x
497497
idxs[yax] = y
498498
idxs[ii] = self._data_idx[ii]
499+
idxs[:3] = idxs[self._order]
499500
self._set_position(*np.dot(self._affine, idxs)[:3])
500501
self._draw()
501502

0 commit comments

Comments
 (0)