Button release event handler.
(self, event)
| 4220 | |
| 4221 | @_call_with_reparented_event |
| 4222 | def _release(self, event): |
| 4223 | """Button release event handler.""" |
| 4224 | # Release active tool handle. |
| 4225 | if self._active_handle_idx >= 0: |
| 4226 | if event.button == 3: |
| 4227 | self._remove_vertex(self._active_handle_idx) |
| 4228 | self._draw_polygon() |
| 4229 | self._active_handle_idx = -1 |
| 4230 | |
| 4231 | # Complete the polygon. |
| 4232 | elif len(self._xys) > 3 and self._xys[-1] == self._xys[0]: |
| 4233 | self._selection_completed = True |
| 4234 | if self._draw_box and self._box is None: |
| 4235 | self._add_box() |
| 4236 | |
| 4237 | # Place new vertex. |
| 4238 | elif (not self._selection_completed |
| 4239 | and 'move_all' not in self._state |
| 4240 | and 'move_vertex' not in self._state): |
| 4241 | self._xys.insert(-1, (event.xdata, event.ydata)) |
| 4242 | |
| 4243 | if self._selection_completed: |
| 4244 | self.onselect(self.verts) |
| 4245 | |
| 4246 | @_call_with_reparented_event |
| 4247 | def onmove(self, event): |
nothing calls this directly
no test coverage detected