8000 Rename/remove _lastCursor, as needed. by anntzer · Pull Request #21580 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Rename/remove _lastCursor, as needed. #21580

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
Nov 10, 2021
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2929,7 +2929,7 @@ def __init__(self, canvas):
canvas.toolbar = self
self._nav_stack = cbook.Stack()
# This cursor will be set after the initial draw.
self._lastCursor = tools.Cursors.POINTER
self._last_cursor = tools.Cursors.POINTER

self._id_press = self.canvas.mpl_connect(
'button_press_event', self._zoom_pan_handler)
Expand Down Expand Up @@ -2998,16 +2998,16 @@ def _update_cursor(self, event):
"""
if self.mode and event.inaxes and event.inaxes.get_navigate():
if (self.mode == _Mode.ZOOM
and self._lastCursor != tools.Cursors.SELECT_REGION):
and self._last_cursor != tools.Cursors.SELECT_REGION):
self.canvas.set_cursor(tools.Cursors.SELECT_REGION)
self._lastCursor = tools.Cursors.SELECT_REGION
self._last_cursor = tools.Cursors.SELECT_REGION
elif (self.mode == _Mode.PAN
and self._lastCursor != tools.Cursors.MOVE):
and self._last_cursor != tools.Cursors.MOVE):
self.canvas.set_cursor(tools.Cursors.MOVE)
self._lastCursor = tools.Cursors.MOVE
elif self._lastCursor != tools.Cursors.POINTER:
self._last_cursor = tools.Cursors.MOVE
elif self._last_cursor != tools.Cursors.POINTER:
self.canvas.set_cursor(tools.Cursors.POINTER)
self._lastCursor = tools.Cursors.POINTER
self._last_cursor = tools.Cursors.POINTER

@contextmanager
def _wait_cursor_for_draw_cm(self):
Expand All @@ -3027,7 +3027,7 @@ def _wait_cursor_for_draw_cm(self):
self.canvas.set_cursor(tools.Cursors.WAIT)
yield
finally:
self.canvas.set_cursor(self._lastCursor)
self.canvas.set_cursor(self._last_cursor)
else:
yield

Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/backends/backend_gtk3.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def __init__(self, figure=None):
GObject.GObject.__init__(self)

self._idle_draw_id = 0
self._lastCursor = None
self._rubberband_rect = None

self.connect('scroll_event', self.scroll_event)
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/backends/backend_gtk4.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def __init__(self, figure=None):
self.set_vexpand(True)

self._idle_draw_id = 0
self._lastCursor = None
self._rubberband_rect = None

self.set_draw_func(self._draw_func)
Expand Down
0