Skip to content

Commit 34a52c8

Browse files
committed
change cursor inmediately after toggle
1 parent d18206f commit 34a52c8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/matplotlib/backend_bases.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -3476,6 +3476,9 @@ def _handle_toggle(self, name, event=None, from_toolbar=False):
34763476
for a in self.canvas.figure.get_axes():
34773477
a.set_navigate_mode(self._toggled)
34783478

3479+
# Change the cursor inmediately, don't wait for mouse move
3480+
self._set_cursor(event)
3481+
34793482
def get_tools(self):
34803483
"""Return the tools controlled by `Navigation`"""
34813484

@@ -3488,7 +3491,10 @@ def get_tools(self):
34883491
'keymap': keys}
34893492
return d
34903493

3491-
def _mouse_move(self, event):
3494+
def _set_cursor(self, event):
3495+
"""Call the backend specific set_cursor method,
3496+
if the pointer is inaxes
3497+
"""
34923498
if not event.inaxes or not self._toggled:
34933499
if self._last_cursor != self._default_cursor:
34943500
self.set_cursor(self._default_cursor)
@@ -3500,6 +3506,9 @@ def _mouse_move(self, event):
35003506
self.set_cursor(cursor)
35013507
self._last_cursor = cursor
35023508

3509+
def _mouse_move(self, event):
3510+
self._set_cursor(event)
3511+
35033512
if self.toolbar is None or self.messagelock.locked():
35043513
return
35053514

0 commit comments

Comments
 (0)