| 3817 | self.extents = self.extents |
| 3818 | |
| 3819 | def _draw_shape(self, extents): |
| 3820 | x0, x1, y0, y1 = extents |
| 3821 | xmin, xmax = sorted([x0, x1]) |
| 3822 | ymin, ymax = sorted([y0, y1]) |
| 3823 | xlim = sorted(self.ax.get_xlim()) |
| 3824 | ylim = sorted(self.ax.get_ylim()) |
| 3825 | |
| 3826 | xmin = max(xlim[0], xmin) |
| 3827 | ymin = max(ylim[0], ymin) |
| 3828 | xmax = min(xmax, xlim[1]) |
| 3829 | ymax = min(ymax, ylim[1]) |
| 3830 | |
| 3831 | self._selection_artist.set_x(xmin) |
| 3832 | self._selection_artist.set_y(ymin) |
| 3833 | self._selection_artist.set_width(xmax - xmin) |
| 3834 | self._selection_artist.set_height(ymax - ymin) |
| 3835 | self._selection_artist.set_angle(self.rotation) |
| 3836 | |
| 3837 | def _set_active_handle(self, event): |
| 3838 | """Set active handle based on the location of the mouse event.""" |