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 c103278

Browse filesBrowse files
committed
Merge pull request #3474 from fariza/change-cursor-inmediately
ENH : call set cursor on zoom/pan toggle
1 parent ff4932d commit c103278
Copy full SHA for c103278

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2458,9 +2458,11 @@ def key_press_handler(event, canvas, toolbar=None):
24582458
# pan mnemonic (default key 'p')
24592459
elif event.key in pan_keys:
24602460
toolbar.pan()
2461+
toolbar._set_cursor(event)
24612462
# zoom mnemonic (default key 'o')
24622463
elif event.key in zoom_keys:
24632464
toolbar.zoom()
2465+
toolbar._set_cursor(event)
24642466
# saving current figure (default key 's')
24652467
elif event.key in save_keys:
24662468
toolbar.save_figure()
@@ -2741,7 +2743,7 @@ class implementation.
27412743
"""
27422744
raise NotImplementedError
27432745

2744-
def mouse_move(self, event):
2746+
def _set_cursor(self, event):
27452747
if not event.inaxes or not self._active:
27462748
if self._lastCursor != cursors.POINTER:
27472749
self.set_cursor(cursors.POINTER)
@@ -2757,6 +2759,9 @@ def mouse_move(self, event):
27572759

27582760
self._lastCursor = cursors.MOVE
27592761

2762+
def mouse_move(self, event):
2763+
self._set_cursor(event)
2764+
27602765
if event.inaxes and event.inaxes.get_navigate():
27612766

27622767
try:

0 commit comments

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