Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9f94bd

Browse files
committed
Rename/remove _lastCursor, as needed.
UnCamelCase it in NavigationToolbar2. Remove it from FigureCanvasGTK{3,4} (it is now never accessed via the canvas, only via the toolbar; this likely goes back to the original (pre-NT2) toolbar design.
1 parent a3ba7cf commit b9f94bd

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,7 @@ def __init__(self, canvas):
29292929
canvas.toolbar = self
29302930
self._nav_stack = cbook.Stack()
29312931
# This cursor will be set after the initial draw.
2932-
self._lastCursor = tools.Cursors.POINTER
2932+
self._last_cursor = tools.Cursors.POINTER
29332933

29342934
self._id_press = self.canvas.mpl_connect(
29352935
'button_press_event', self._zoom_pan_handler)
@@ -2998,16 +2998,16 @@ def _update_cursor(self, event):
29982998
"""
29992999
if self.mode and event.inaxes and event.inaxes.get_navigate():
30003000
if (self.mode == _Mode.ZOOM
3001-
and self._lastCursor != tools.Cursors.SELECT_REGION):
3001+
and self._last_cursor != tools.Cursors.SELECT_REGION):
30023002
self.canvas.set_cursor(tools.Cursors.SELECT_REGION)
3003-
self._lastCursor = tools.Cursors.SELECT_REGION
3003+
self._last_cursor = tools.Cursors.SELECT_REGION
30043004
elif (self.mode == _Mode.PAN
3005-
and self._lastCursor != tools.Cursors.MOVE):
3005+
and self._last_cursor != tools.Cursors.MOVE):
30063006
self.canvas.set_cursor(tools.Cursors.MOVE)
3007-
self._lastCursor = tools.Cursors.MOVE
3008-
elif self._lastCursor != tools.Cursors.POINTER:
3007+
self._last_cursor = tools.Cursors.MOVE
3008+
elif self._last_cursor != tools.Cursors.POINTER:
30093009
self.canvas.set_cursor(tools.Cursors.POINTER)
3010-
self._lastCursor = tools.Cursors.POINTER
3010+
self._last_cursor = tools.Cursors.POINTER
30113011

30123012
@contextmanager
30133013
def _wait_cursor_for_draw_cm(self):
@@ -3027,7 +3027,7 @@ def _wait_cursor_for_draw_cm(self):
30273027
self.canvas.set_cursor(tools.Cursors.WAIT)
30283028
yield
30293029
finally:
3030-
self.canvas.set_cursor(self._lastCursor)
3030+
self.canvas.set_cursor(self._last_cursor)
30313031
else:
30323032
yield
30333033

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def __init__(self, figure=None):
100100
GObject.GObject.__init__(self)
101101

102102
self._idle_draw_id = 0
103-
self._lastCursor = None
104103
self._rubberband_rect = None
105104

106105
self.connect('scroll_event', self.scroll_event)

lib/matplotlib/backends/backend_gtk4.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def __init__(self, figure=None):
6262
self.set_vexpand(True)
6363

6464
self._idle_draw_id = 0
65-
self._lastCursor = None
6665
self._rubberband_rect = None
6766

6867
self.set_draw_func(self._draw_func)

0 commit comments

Comments
 (0)