93 return (X >= Left) && (X <= Right) && (Y >= Top) && (Y <= Bottom);
100 template <
typename T>
104 Rect Overlapping(std::max(Left, Rectangle.
Left),
105 std::max(Top, Rectangle.
Top),
106 std::min(Right, Rectangle.
Right),
107 std::min(Bottom, Rectangle.
Bottom));
113 *OverlappingRect = Overlapping;
119 *OverlappingRect =
Rect(0, 0, 0, 0);
Rect is an utility class for manipulating rectangles.
T Right
Right coordinate of the rectangle.
T GetHeight() const
Get the height of the rectangle.
T GetWidth() const
Get the width of the rectangle.
void Offset(T OffsetX, T OffsetY)
Move the whole rectangle by the given offset.
Rect()
Default constructor.
bool Intersects(const Rect< T > &Rectangle, Rect< T > *OverlappingRect=NULL) const
Check intersection between two rectangles.
T Bottom
Bottom coordinate of the rectangle.
bool Contains(T X, T Y) const
Check if a point is inside the rectangle's area.
T Top
Top coordinate of the rectangle.
T Left
Left coordinate of the rectangle.