Skip to content

Commit b8c174b

Browse files
committed
1 parent 349ff97 commit b8c174b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/backend_bases.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3042,7 +3042,10 @@ def release_zoom(self, event):
30423042
x, y = event.x, event.y
30433043
lastx, lasty, a, ind, view = cur_xypress
30443044
# ignore singular clicks - 5 pixels is a threshold
3045-
if abs(x - lastx) < 5 or abs(y - lasty) < 5:
3045+
# allows the user to "cancel" a zoom action
3046+
# by zooming by less than 5 pixels
3047+
if (abs(x - lastx) < 5 and self._zoom_mode!="y") \
3048+
or (abs(y - lasty) < 5 and self._zoom_mode!="x"):
30463049
self._xypress = None
30473050
self.release(event)
30483051
self.draw()

0 commit comments

Comments
 (0)