56 #ifndef FIFE_VIDEO_RECT_H
57 #define FIFE_VIDEO_RECT_H
99 explicit RectType(T x = 0, T y = 0, T w = 0, T h = 0) : x(x), y(y), w(w), h(h) {
108 : x(static_cast<T>(r.x)),
109 y(static_cast<T>(r.y)),
110 w(static_cast<T>(r.w)),
111 h(static_cast<T>(r.h)) {
160 std::ostream& operator<<(std::ostream& os, const RectType<T>& r) {
162 os <<
"("<<r.x<<
","<<r.y<<
")-("<<r.w<<
","<<r.h<<
")";
180 x == rect.
x && y == rect.
y && w == rect.
w && h == rect.
h;
186 (((point.x >= x) && (point.x <= x + w))
187 && ((point.y >= y) && (point.y <= y + h)));
207 if (x + w > rectangle.
w) {
211 if (y + h > rectangle.
h) {
218 if (w <= 0 || h <= 0) {
228 T _x = x - rectangle.
x;
229 T _y = y - rectangle.
y;
244 if (_x + _w > rectangle.
w) {
245 _w = rectangle.
w - _x;
248 if (_y + _h > rectangle.
h) {
249 _h = rectangle.
h - _y;
252 if (_w <= 0 || _h <= 0) {
bool operator==(const RectType< T > &rect) const
bool contains(const PointType2D< T > &point) const
bool intersectInplace(const RectType< T > &rect)
RectType(T x=0, T y=0, T w=0, T h=0)
RectType(const RectType< U > &r)
bool intersects(const RectType< T > &rect) const
credit to phoku for his NodeDisplay example which the visitor code is adapted from ( he coded the qua...