Skip to content

Commit

Permalink
Merge pull request #3474 from fariza/change-cursor-inmediately
Browse files Browse the repository at this point in the history
ENH : call set cursor on zoom/pan toggle
  • Loading branch information
tacaswell committed Sep 9, 2014
2 parents f7c68b6 + 4a910ba commit d78c4e9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2456,9 +2456,11 @@ def key_press_handler(event, canvas, toolbar=None):
# pan mnemonic (default key 'p')
elif event.key in pan_keys:
toolbar.pan()
toolbar._set_cursor(event)
# zoom mnemonic (default key 'o')
elif event.key in zoom_keys:
toolbar.zoom()
toolbar._set_cursor(event)
# saving current figure (default key 's')
elif event.key in save_keys:
toolbar.save_figure()
Expand Down Expand Up @@ -2739,7 +2741,7 @@ class implementation.
"""
raise NotImplementedError

def mouse_move(self, event):
def _set_cursor(self, event):
if not event.inaxes or not self._active:
if self._lastCursor != cursors.POINTER:
self.set_cursor(cursors.POINTER)
Expand All @@ -2755,6 +2757,9 @@ def mouse_move(self, event):

self._lastCursor = cursors.MOVE

def mouse_move(self, event):
self._set_cursor(event)

if event.inaxes and event.inaxes.get_navigate():

try:
Expand Down

0 comments on commit d78c4e9

Please sign in to comment.