44Rect<T>::Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord) :
58T Rect<T>::GetWidth()
const
68T Rect<T>::GetHeight()
const
78void Rect<T>::Offset(T OffsetX, T OffsetY)
91bool Rect<T>::Contains(T X, T Y)
const
93 return (X >= Left) && (X <=
Right) && (Y >= Top) && (Y <= Bottom);
101bool Rect<T>::Intersects(
const Rect<T>& Rectangle, Rect<T>* OverlappingRect)
const
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));
110 if ((Overlapping.Left < Overlapping.Right) && (Overlapping.Top < Overlapping.Bottom))
113 *OverlappingRect = Overlapping;
119 *OverlappingRect = Rect(0, 0, 0, 0);