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

Method onmove

lib/matplotlib/widgets.py:4247–4263  ·  view source on GitHub ↗

Cursor move event handler and validator.

(self, event)

Source from the content-addressed store, hash-verified

4245
4246 @_call_with_reparented_event
4247 def onmove(self, event):
4248 """Cursor move event handler and validator."""
4249 # Method overrides _SelectorWidget.onmove because the polygon selector
4250 # needs to process the move callback even if there is no button press.
4251 # _SelectorWidget.onmove include logic to ignore move event if
4252 # _eventpress is None.
4253 if self.ignore(event):
4254 # Hide the cursor when interactive zoom/pan is active
4255 if not self.canvas.widgetlock.available(self) and self._xys:
4256 self._xys[-1] = (np.nan, np.nan)
4257 self._draw_polygon()
4258 return False
4259
4260 else:
4261 event = self._clean_event(event)
4262 self._onmove(event)
4263 return True
4264
4265 def _onmove(self, event):
4266 """Cursor move event handler."""

Callers

nothing calls this directly

Calls 5

_draw_polygonMethod · 0.95
_onmoveMethod · 0.95
availableMethod · 0.80
_clean_eventMethod · 0.80
ignoreMethod · 0.45

Tested by

no test coverage detected