- """
- def _clip(self, rectangle):
- if self._core.rotation in (90, 270):
- width, height = self._core.height, self._core.width
- else:
- width, height = self._core.width, self._core.height
-
- rectangle.x1 = max(rectangle.x1, 0)
- rectangle.y1 = max(rectangle.y1, 0)
- rectangle.x2 = min(rectangle.x2, width)
- rectangle.y2 = min(rectangle.y2, height)
-
- return rectangle
- """
-