8000 Backport PR #22082 on branch v3.5.x (Update both zoom/pan states on wx when triggering from keyboard.) by meeseeksmachine · Pull Request #22155 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #22082 on branch v3.5.x (Update both zoom/pan states on wx when triggering from keyboard.) #22155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/matplotlib/backends/backend_wx.py
6688
Original file line number Diff line number Diff line change
Expand Up @@ -1140,15 +1140,19 @@ def _icon(name):
def get_canvas(self, frame, fig):
return type(self.canvas)(frame, -1, fig)

def _update_buttons_checked(self):
if "Pan" in self.wx_ids:
self.ToggleTool(self.wx_ids["Pan"], self.mode.name == "PAN")
if "Zoom" in self.wx_ids:
self.ToggleTool(self.wx_ids["Zoom"], self.mode.name == "ZOOM")

def zoom(self, *args):
tool = self.wx_ids['Zoom']
self.ToggleTool(tool, not self.GetToolState(tool))
super().zoom(*args)
self._update_buttons_checked()

def pan(self, *args):
tool = self.wx_ids['Pan']
self.ToggleTool(tool, not self.GetToolState(tool))
super().pan(*args)
self._update_buttons_checked()

def save_figure(self, *args):
# Fetch the required filename and file type.
Expand Down
0