Preprocess an event: - Replace *event* by the previous event if *event* has no ``xdata``. - Get ``xdata`` and ``ydata`` from this widget's Axes, and clip them to the axes limits. - Update the previous event.
(self, event)
| 2463 | return xdata, ydata |
| 2464 | |
| 2465 | def _clean_event(self, event): |
| 2466 | """ |
| 2467 | Preprocess an event: |
| 2468 | |
| 2469 | - Replace *event* by the previous event if *event* has no ``xdata``. |
| 2470 | - Get ``xdata`` and ``ydata`` from this widget's Axes, and clip them to the axes |
| 2471 | limits. |
| 2472 | - Update the previous event. |
| 2473 | """ |
| 2474 | if event.xdata is None: |
| 2475 | event = self._prev_event |
| 2476 | else: |
| 2477 | event = copy.copy(event) |
| 2478 | event.xdata, event.ydata = self._get_data(event) |
| 2479 | self._prev_event = event |
| 2480 | return event |
| 2481 | |
| 2482 | @_call_with_reparented_event |
| 2483 | def press(self, event): |