Skip to content

FIX: put Nav Home view back inside pan/zoom #9958

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
Dec 9, 2017
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
17 changes: 8 additions & 9 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2802,15 +2802,6 @@ def __init__(self, canvas):
self.mode = '' # a mode string for the status bar
self.set_history_buttons()

@partial(canvas.mpl_connect, 'draw_event')
def update_stack(event):
nav_info = self._nav_stack()
if (nav_info is None # True initial navigation info.
# An axes has been added or removed, so update the
# navigation info too.
or set(nav_info) != set(self.canvas.figure.axes)):
self.push_current()

def set_message(self, s):
"""Display a message on toolbar or in status bar."""

Expand Down Expand Up @@ -2955,6 +2946,10 @@ def press_pan(self, event):
self._button_pressed = None
return

if self._nav_stack() is None:
# set the home button to this view
self.push_current()

x, y = event.x, event.y
self._xypress = []
for i, a in enumerate(self.canvas.figure.get_axes()):
Expand Down Expand Up @@ -2990,6 +2985,10 @@ def press_zoom(self, event):
self._button_pressed = None
return

if self._nav_stack() is None:
# set the home button to this view
self.push_current()

x, y = event.x, event.y
self._xypress = []
for i, a in enumerate(self.canvas.figure.get_axes()):
Expand Down