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
1 parent ff4932d commit c103278
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/matplotlib/backend_bases.py
Expand Up @@ -2458,9 +2458,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 @@ -2741,7 +2743,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 @@ -2757,6 +2759,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 c103278

Please sign in to comment.