X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/d63d2c3c6cbbd574dda4f8b00ebe6c661735edd5..03dba41f691f1ae6a315d0a13c5af66fdf93fbfd:/lib/gdi/erect.cpp diff --git a/lib/gdi/erect.cpp b/lib/gdi/erect.cpp index b72e5d04..c17c5cf3 100644 --- a/lib/gdi/erect.cpp +++ b/lib/gdi/erect.cpp @@ -1,5 +1,5 @@ #include -#include +#include /***************************************************************************** eRect member functions @@ -151,8 +151,8 @@ eRect& eRect::operator&=(const eRect &r) eRect eRect::operator|(const eRect &r) const { - if ( isValid() ) { - if ( r.isValid() ) { + if ( valid() ) { + if ( r.valid() ) { eRect tmp; tmp.setLeft( MIN( x1, r.x1 ) ); tmp.setRight( MAX( x2, r.x2 ) ); @@ -202,3 +202,13 @@ bool operator!=( const eRect &r1, const eRect &r2 ) { return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2; } + +void eRect::scale(int x_n, int x_d, int y_n, int y_d) +{ + ASSERT(x_d); ASSERT(y_d); + x1 *= x_n; x1 /= x_d; + x2 *= x_n; x2 /= x_d; + y1 *= y_n; y1 /= y_d; + y2 *= y_n; y2 /= y_d; +} +