8000 Update both zoom/pan states on wx when triggering from keyboard. by anntzer · Pull Request #22082 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Update both zoom/pan states on wx when triggering from keyboard. #22082

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
merged 1 commit into from
Jan 8, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -1134,15 +1134,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