Extend to include rect-like r.
(self, r)
| 14699 | return self |
| 14700 | |
| 14701 | def include_rect(self, r): |
| 14702 | """Extend to include rect-like r.""" |
| 14703 | if len(r) != 4: |
| 14704 | raise ValueError("Rect: bad seq len") |
| 14705 | r = Rect(r) |
| 14706 | if r.is_infinite or self.is_infinite: |
| 14707 | self.x0, self.y0, self.x1, self.y1 = FZ_MIN_INF_RECT, FZ_MIN_INF_RECT, FZ_MAX_INF_RECT, FZ_MAX_INF_RECT |
| 14708 | elif r.is_empty: |
| 14709 | return self |
| 14710 | elif self.is_empty: |
| 14711 | self.x0, self.y0, self.x1, self.y1 = r.x0, r.y0, r.x1, r.y1 |
| 14712 | else: |
| 14713 | self.x0, self.y0, self.x1, self.y1 = util_union_rect(self, r) |
| 14714 | return self |
| 14715 | |
| 14716 | def intersect(self, r): |
| 14717 | """Restrict to common rect with rect-like r.""" |