| 19 | #include "rect.h" |
| 20 | |
| 21 | void Rect::Adjust(int max_width, int max_height) { |
| 22 | if (x < 0) { |
| 23 | width += x; |
| 24 | x = 0; |
| 25 | } |
| 26 | if (y < 0) { |
| 27 | height += y; |
| 28 | y = 0; |
| 29 | } |
| 30 | if (x < max_width && y < max_height) { |
| 31 | if (max_width < x + width) width = max_width - x; |
| 32 | if (max_height < y + height) height = max_height - y; |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | void Rect::Adjust(const Rect& rect) { |
| 37 | if (x < rect.x) { |
no outgoing calls
no test coverage detected