Compute the bounding box of a transformed rectangle. Returns the minimal `Rect` that encloses the given `Rect` after affine transformation. If the transform is axis-aligned, then this bounding box is "tight", in other words the returned `Rect` is the transformed rectangle. The returned rectangle always has non-negative width and height.
(self, rect: Rect)
| 116 | /// |
| 117 | /// The returned rectangle always has non-negative width and height. |
| 118 | pub fn transform_rect_bbox(self, rect: Rect) -> Rect { |
| 119 | let p00 = self * Point::new(rect.x0, rect.y0); |
| 120 | let p01 = self * Point::new(rect.x0, rect.y1); |
| 121 | let p10 = self * Point::new(rect.x1, rect.y0); |
| 122 | let p11 = self * Point::new(rect.x1, rect.y1); |
| 123 | Rect::from_points(p00, p01).union(Rect::from_points(p10, p11)) |
| 124 | } |
| 125 | |
| 126 | /// Is this map finite? |
| 127 | #[inline] |
no test coverage detected