15 Rect() : mTopLeft{0, 0}, mBottomRight{0, 0} {}
21 Rect(const Point2D<T> &tl, const Point2D<T> &br)
22 : mTopLeft(tl), mBottomRight(br)
30 Rect(const T &x1, const T &y1, const T &x2, const T &y2)
31 : mTopLeft{x1, y1}, mBottomRight{x2, y2}
39 Rect(const Rect<T> &src)
42 this->mTopLeft = Point2D<int>{src.mTopLeft};
43 this->mBottomRight = Point2D<int>{src.mBottomRight};
50 Point2D<T> midPoint() const
52 return Point2D<T>{mTopLeft.x + static_cast<T>(width() / 2),
53 mTopLeft.y + static_cast<T>(height() / 2)};
60 T width() const { return mBottomRight.x - mTopLeft.x; }
66 T height() const { return mBottomRight.y - mTopLeft.y; }
76 Point2D<T> mBottomRight;