Remove vertex with index i.
(self, i)
| 4187 | return self._polygon_handles.artists |
| 4188 | |
| 4189 | def _remove_vertex(self, i): |
| 4190 | """Remove vertex with index i.""" |
| 4191 | if (len(self._xys) > 2 and |
| 4192 | self._selection_completed and |
| 4193 | i in (0, len(self._xys) - 1)): |
| 4194 | # If selecting the first or final vertex, remove both first and |
| 4195 | # last vertex as they are the same for a closed polygon |
| 4196 | self._xys.pop(0) |
| 4197 | self._xys.pop(-1) |
| 4198 | # Close the polygon again by appending the new first vertex to the |
| 4199 | # end |
| 4200 | self._xys.append(self._xys[0]) |
| 4201 | else: |
| 4202 | self._xys.pop(i) |
| 4203 | if len(self._xys) <= 2: |
| 4204 | # If only one point left, return to incomplete state to let user |
| 4205 | # start drawing again |
| 4206 | self._selection_completed = False |
| 4207 | self._remove_box() |
| 4208 | |
| 4209 | def _press(self, event): |
| 4210 | """Button press event handler.""" |
no test coverage detected