| 46 | } |
| 47 | |
| 48 | Rect intersection(const Rect r2) const |
| 49 | { |
| 50 | int left = std::max(this->origin.x, r2.origin.x); |
| 51 | int top = std::max(this->origin.y, r2.origin.y); |
| 52 | int right = std::min(this->origin.x + this->size.width, r2.origin.x + r2.size.width); |
| 53 | int bottom = std::min(this->origin.y + this->size.height, r2.origin.y + r2.size.height); |
| 54 | |
| 55 | return Rect(left, top, right - left, bottom - top); |
| 56 | } |
| 57 | |
| 58 | int32_t width() const |
| 59 | { |
no test coverage detected