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

Method _press

lib/matplotlib/widgets.py:4209–4219  ·  view source on GitHub ↗

Button press event handler.

(self, event)

Source from the content-addressed store, hash-verified

4207 self._remove_box()
4208
4209 def _press(self, event):
4210 """Button press event handler."""
4211 # Check for selection of a tool handle.
4212 if ((self._selection_completed or 'move_vertex' in self._state)
4213 and len(self._xys) > 0):
4214 h_idx, h_dist = self._polygon_handles.closest(event.x, event.y)
4215 if h_dist < self.grab_range:
4216 self._active_handle_idx = h_idx
4217 # Save the vertex positions at the time of the press event (needed to
4218 # support the 'move_all' state modifier).
4219 self._xys_at_press = self._xys.copy()
4220
4221 @_call_with_reparented_event
4222 def _release(self, event):

Callers

nothing calls this directly

Calls 2

closestMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected