(self, ax, xy, callback, *, useblit=True, props=None)
| 4406 | .. versionadded:: 3.9 |
| 4407 | """ |
| 4408 | def __init__(self, ax, xy, callback, *, useblit=True, props=None): |
| 4409 | super().__init__(ax) |
| 4410 | |
| 4411 | self.useblit = useblit and self.canvas.supports_blit # TODO: Make dynamic |
| 4412 | if self.useblit: |
| 4413 | self.background = self.canvas.copy_from_bbox(self.ax.bbox) |
| 4414 | |
| 4415 | style = {'linestyle': '-', 'color': 'black', 'lw': 2} |
| 4416 | |
| 4417 | if props is not None: |
| 4418 | style.update(props) |
| 4419 | |
| 4420 | x, y = xy |
| 4421 | self.verts = [(x, y)] |
| 4422 | self.line = Line2D([x], [y], **style) |
| 4423 | self.ax.add_line(self.line) |
| 4424 | self.callback = callback |
| 4425 | self.connect_event('button_release_event', self.onrelease) |
| 4426 | self.connect_event('motion_notify_event', self.onmove) |
| 4427 | |
| 4428 | @_call_with_reparented_event |
| 4429 | def onrelease(self, event): |
no test coverage detected