Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca0427b

Browse files
committed
Merge pull request #5008 from sdementen/patch-1
fix #5007
2 parents fb12c7b + f26592d commit ca0427b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 4 additions & 1 deletion
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") or
3048+
(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)