|
31 | 31 | import matplotlib.transforms as mtransforms
|
32 | 32 | from matplotlib.axes import Axes
|
33 | 33 | from matplotlib.axes._base import _axis_method_wrapper, _process_plot_format
|
34 |
| -from matplotlib.backend_bases import _Mode |
35 | 34 | from matplotlib.transforms import Bbox
|
36 | 35 | from matplotlib.tri.triangulation import Triangulation
|
37 | 36 |
|
@@ -1012,7 +1011,9 @@ def _button_press(self, event):
|
1012 | 1011 | def _button_release(self, event):
|
1013 | 1012 | self.button_pressed = None
|
1014 | 1013 | toolbar = getattr(self.figure.canvas, "toolbar")
|
1015 |
| - if toolbar and toolbar.mode not in (_Mode.PAN, _Mode.ZOOM): |
| 1014 | + # backend_bases.release_zoom and backend_bases.release_pan call |
| 1015 | + # push_current, so check the navigation mode so we don't call it twice |
| 1016 | + if toolbar and self.get_navigate_mode() is None: |
1016 | 1017 | self.figure.canvas.toolbar.push_current()
|
1017 | 1018 |
|
1018 | 1019 | def _get_view(self):
|
@@ -1162,7 +1163,7 @@ def drag_pan(self, button, key, x, y):
|
1162 | 1163 | if du == 0 and dv == 0:
|
1163 | 1164 | return
|
1164 | 1165 |
|
1165 |
| - # Transform the pan from the view axes to the data axees |
| 1166 | + # Transform the pan from the view axes to the data axes |
1166 | 1167 | R = np.array([self._view_u, self._view_v, self._view_w])
|
1167 | 1168 | R = -R / self._box_aspect * self._dist
|
1168 | 1169 | duvw_projected = R.T @ np.array([du, dv, dw])
|
|
0 commit comments