Callback for mouse moves in zoom-to-rectangle mode.
(self, event)
| 764 | self._mouse_move(event) |
| 765 | |
| 766 | def _mouse_move(self, event): |
| 767 | """Callback for mouse moves in zoom-to-rectangle mode.""" |
| 768 | |
| 769 | if self._xypress: |
| 770 | x, y = event.x, event.y |
| 771 | lastx, lasty, a, ind, view = self._xypress[0] |
| 772 | (x1, y1), (x2, y2) = np.clip( |
| 773 | [[lastx, lasty], [x, y]], a.bbox.min, a.bbox.max) |
| 774 | if self._zoom_mode == "x": |
| 775 | y1, y2 = a.bbox.intervaly |
| 776 | elif self._zoom_mode == "y": |
| 777 | x1, x2 = a.bbox.intervalx |
| 778 | self.toolmanager.trigger_tool( |
| 779 | 'rubberband', self, data=(x1, y1, x2, y2)) |
| 780 | |
| 781 | def _release(self, event): |
| 782 | """Callback for mouse button releases in zoom-to-rectangle mode.""" |
no test coverage detected