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

Method _on_key_release

lib/matplotlib/widgets.py:4313–4329  ·  view source on GitHub ↗

Key release event handler.

(self, event)

Source from the content-addressed store, hash-verified

4311 self._draw_polygon()
4312
4313 def _on_key_release(self, event):
4314 """Key release event handler."""
4315 # Add back the pending vertex if leaving the 'move_vertex' or
4316 # 'move_all' mode (by checking the released key)
4317 if (not self._selection_completed
4318 and
4319 (event.key == self._state_modifier_keys.get('move_vertex')
4320 or event.key == self._state_modifier_keys.get('move_all'))):
4321 self._xys.append((event.xdata, event.ydata))
4322 self._draw_polygon()
4323 # Reset the polygon if the released key is the 'clear' key.
4324 elif event.key == self._state_modifier_keys.get('clear'):
4325 event = self._clean_event(event)
4326 self._xys = [(event.xdata, event.ydata)]
4327 self._selection_completed = False
4328 self._remove_box()
4329 self.set_visible(True)
4330
4331 def _draw_polygon_without_update(self):
4332 """Redraw the polygon based on new vertex positions, no update()."""

Callers

nothing calls this directly

Calls 5

_draw_polygonMethod · 0.95
_remove_boxMethod · 0.95
_clean_eventMethod · 0.80
getMethod · 0.45
set_visibleMethod · 0.45

Tested by

no test coverage detected