MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _update_cursor

Method _update_cursor

lib/matplotlib/backend_bases.py:3045–3060  ·  view source on GitHub ↗

Update the cursor after a mouse move event or a tool (de)activation.

(self, event)

Source from the content-addressed store, hash-verified

3043 self._update_view()
3044
3045 def _update_cursor(self, event):
3046 """
3047 Update the cursor after a mouse move event or a tool (de)activation.
3048 """
3049 if self.mode and event.inaxes and event.inaxes.get_navigate():
3050 if (self.mode == _Mode.ZOOM
3051 and self._last_cursor != tools.Cursors.SELECT_REGION):
3052 self.canvas.set_cursor(tools.Cursors.SELECT_REGION)
3053 self._last_cursor = tools.Cursors.SELECT_REGION
3054 elif (self.mode == _Mode.PAN
3055 and self._last_cursor != tools.Cursors.MOVE):
3056 self.canvas.set_cursor(tools.Cursors.MOVE)
3057 self._last_cursor = tools.Cursors.MOVE
3058 elif self._last_cursor != tools.Cursors.POINTER:
3059 self.canvas.set_cursor(tools.Cursors.POINTER)
3060 self._last_cursor = tools.Cursors.POINTER
3061
3062 @contextmanager
3063 def _wait_cursor_for_draw_cm(self):

Callers 2

mouse_moveMethod · 0.95
key_press_handlerFunction · 0.80

Calls 2

get_navigateMethod · 0.80
set_cursorMethod · 0.45

Tested by

no test coverage detected