diff options
| author | Felix Domke <felix.domke@multimedia-labs.de> | 2009-07-17 12:46:37 +0200 |
|---|---|---|
| committer | Felix Domke <felix.domke@multimedia-labs.de> | 2009-07-17 12:46:37 +0200 |
| commit | f27bd5e1b2c49b0db87dbac70298ad33d2e4d537 (patch) | |
| tree | 2d10a66a2d01d1df5fcd27feded1b3c8d6c38abf /lib/gdi/erect.cpp | |
| parent | 767c0c99050c9ba714841d556065653011a3bc68 (diff) | |
| download | enigma2-f27bd5e1b2c49b0db87dbac70298ad33d2e4d537.tar.gz enigma2-f27bd5e1b2c49b0db87dbac70298ad33d2e4d537.zip | |
un-inline scale, assert non-zero denominators
Diffstat (limited to 'lib/gdi/erect.cpp')
| -rw-r--r-- | lib/gdi/erect.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/gdi/erect.cpp b/lib/gdi/erect.cpp index 43cefc53..c17c5cf3 100644 --- a/lib/gdi/erect.cpp +++ b/lib/gdi/erect.cpp @@ -1,4 +1,5 @@ #include <lib/gdi/erect.h> +#include <lib/base/eerror.h> /***************************************************************************** eRect member functions @@ -201,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; +} + |
