+
+ inline bool Intersects(const TRect& other) const
+ {
+ if (x + w < other.x) return false;
+ if (y + h < other.y) return false;
+ if (x > other.x + other.w) return false;
+ if (y > other.y + other.h) return false;
+ return true;
+ }
+
+ template <class B> TRect<B> Convert() const {return TRect<B>(B(x), B(y), B(w), B(h));}
+
+ template <class B> TRect<T> & operator=(const TRect<B> & equ)
+ {
+ x = T(equ.x);
+ y = T(equ.y);
+ w = T(equ.w);
+ h = T(equ.h);
+ return *this;
+ }