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 00c4b80

Browse filesBrowse files
authored
Merge pull request #9958 from jklymak/fix-toolbarstack
FIX: put Nav Home view back inside pan/zoom
2 parents baa5f8e + ff81cd3 commit 00c4b80
Copy full SHA for 00c4b80

File tree

Expand file treeCollapse file tree

1 file changed

+8
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-9
lines changed

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+8-9Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,15 +2802,6 @@ def __init__(self, canvas):
28022802
self.mode = '' # a mode string for the status bar
28032803
self.set_history_buttons()
28042804

2805-
@partial(canvas.mpl_connect, 'draw_event')
2806-
def update_stack(event):
2807-
nav_info = self._nav_stack()
2808-
if (nav_info is None # True initial navigation info.
2809-
# An axes has been added or removed, so update the
2810-
# navigation info too.
2811-
or set(nav_info) != set(self.canvas.figure.axes)):
2812-
self.push_current()
2813-
28142805
def set_message(self, s):
28152806
"""Display a message on toolbar or in status bar."""
28162807

@@ -2955,6 +2946,10 @@ def press_pan(self, event):
29552946
self._button_pressed = None
29562947
return
29572948

2949+
if self._nav_stack() is None:
2950+
# set the home button to this view
2951+
self.push_current()
2952+
29582953
x, y = event.x, event.y
29592954
self._xypress = []
29602955
for i, a in enumerate(self.canvas.figure.get_axes()):
@@ -2990,6 +2985,10 @@ def press_zoom(self, event):
29902985
self._button_pressed = None
29912986
return
29922987

2988+
if self._nav_stack() is None:
2989+
# set the home button to this view
2990+
self.push_current()
2991+
29932992
x, y = event.x, event.y
29942993
self._xypress = []
29952994
for i, a in enumerate(self.canvas.figure.get_axes()):

0 commit comments

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