Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07754f0

Browse filesBrowse files
committed
Correctly sync state of wx toolbar buttons when triggered by keyboard.
Previously, pressing "p" would unclick the "Pan" button if it was already pressed, but not press it if it wasn't (even though it did correctly start panning). Fix that.
1 parent 5173cda commit 07754f0
Copy full SHA for 07754f0

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,12 +1179,14 @@ def get_canvas(self, frame, fig):
11791179
return type(self.canvas)(frame, -1, fig)
11801180

11811181
def zoom(self, *args):
1182-
self.ToggleTool(self.wx_ids['Pan'], False)
1183-
NavigationToolbar2.zoom(self, *args)
1182+
tool = self.wx_ids['Zoom']
1183+
self.ToggleTool(tool, not self.GetToolState(tool))
1184+
super().zoom(*args)
11841185

11851186
def pan(self, *args):
1186-
self.ToggleTool(self.wx_ids['Zoom'], False)
1187-
NavigationToolbar2.pan(self, *args)
1187+
tool = self.wx_ids['Pan']
1188+
self.ToggleTool(tool, not self.GetToolState(tool))
1189+
super().pan(*args)
11881190

11891191
def save_figure(self, *args):
11901192
# Fetch the required filename and file type.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.