| 953 | |
| 954 | |
| 955 | bool InRect( // is the center of rect within the enclosing rect? |
| 956 | const Rect& rect, // in |
| 957 | const Rect& enclosing) // in |
| 958 | { |
| 959 | int x = rect.x + rect.width / 2; // center of rectangle |
| 960 | int y = rect.y + rect.height / 2; |
| 961 | |
| 962 | return x >= enclosing.x && |
| 963 | x <= enclosing.x + enclosing.width && |
| 964 | y >= enclosing.y && |
| 965 | y <= enclosing.y + enclosing.height; |
| 966 | } |
| 967 | |
| 968 | bool InRect( // is x,y within the enclosing rect? |
| 969 | double x, // in |
no outgoing calls
no test coverage detected