| 15 | } |
| 16 | |
| 17 | void Rect::join(const Rect& r) { |
| 18 | if (r.isEmpty()) { |
| 19 | return; |
| 20 | } |
| 21 | |
| 22 | if (this->isEmpty()) { |
| 23 | *this = r; |
| 24 | } else { |
| 25 | left = std::min(left, r.left); |
| 26 | top = std::min(top, r.top); |
| 27 | right = std::max(right, r.right); |
| 28 | bottom = std::max(bottom, r.bottom); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | Rect Rect::makeFittingSize(Size size, FittingSizeMode mode) const { |
| 33 | auto selfWidth = width(); |