(self, left=0, right=0, top=0, bottom=0, safe_mode=True)
| 715 | raise Exception(f"Invalid input type {other.__class__} for other") |
| 716 | |
| 717 | def pad(self, left=0, right=0, top=0, bottom=0, safe_mode=True): |
| 718 | |
| 719 | x_1 = self.x_1 - left |
| 720 | y_1 = self.y_1 - top |
| 721 | x_2 = self.x_2 + right |
| 722 | y_2 = self.y_2 + bottom |
| 723 | |
| 724 | if safe_mode: |
| 725 | x_1 = max(0, x_1) |
| 726 | y_1 = max(0, y_1) |
| 727 | |
| 728 | return self.__class__(x_1, y_1, x_2, y_2) |
| 729 | |
| 730 | def shift(self, shift_distance=0): |
| 731 |
no outgoing calls