10000 Slightly simplify twin axes detection in MEP22 zoom. · matplotlib/matplotlib@339c630 · GitHub
[go: up one dir, main page]

Skip to content

Commit 339c630

Browse files
committed
Slightly simplify twin axes detection in MEP22 zoom.
1 parent 4e20f15 commit 339c630

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/matplotlib/backend_tools.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ def _release(self, event):
821821
self._cancel_action()
822822
return
823823

824-
last_a = []
824+
done_ax = []
825825

826826
for cur_xypress in self._xypress:
827827
x, y = event.x, event.y
@@ -832,14 +832,9 @@ def _release(self, event):
832832
return
833833

834834
# detect twinx, twiny axes and avoid double zooming
835-
twinx, twiny = False, False
836-
if last_a:
837-
for la in last_a:
838-
if a.get_shared_x_axes().joined(a, la):
839-
twinx = True
840-
if a.get_shared_y_axes().joined(a, la):
841-
twiny = True
842-
last_a.append(a)
835+
twinx = any(a.get_shared_x_axes().joined(a, a1) for a1 in done_ax)
836+
twiny = any(a.get_shared_y_axes().joined(a, a1) for a1 in done_ax)
837+
done_ax.append(a)
843838

844839
if self._button_pressed == 1:
845840
direction = 'in'

0 commit comments

Comments
 (0)
0