| 93 | } |
| 94 | |
| 95 | Point Rect::center() const { |
| 96 | return {(int) ((double) (this->top) + 0.5f * (double) (this->bottom - this->top)), |
| 97 | (int) ((double) this->left + 0.5f * (double) (this->right - this->left))}; |
| 98 | } |
| 99 | |
| 100 | bool Rect::contains(const Point &point) const { |
| 101 | return point.x >= this->left && point.x <= this->right |