| 340 | self.markXApproximate(event.xdata) |
| 341 | |
| 342 | def OnMplCanvasRelease(self, event): |
| 343 | if event.button == 1: |
| 344 | if self.mplOnDragHandler: |
| 345 | self.canvas.mpl_disconnect(self.mplOnDragHandler) |
| 346 | self.mplOnDragHandler = None |
| 347 | if self.mplOnReleaseHandler: |
| 348 | self.canvas.mpl_disconnect(self.mplOnReleaseHandler) |
| 349 | self.mplOnReleaseHandler = None |
| 350 | # Do not write markX here because of strange mouse behavior: when dragging, |
| 351 | # sometimes when you release button, x coordinate changes. To avoid that, |
| 352 | # we just re-use coordinates set on click/drag and just request to redraw |
| 353 | # using accurate data |
| 354 | self.draw(accurateMarks=True) |