X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fplat%2FOpenGL.cc;h=3c8cf6ad73369948d141fa4a302e4238de40a998;hb=de378041d5ca2aca1a2b5a31ef15ae90a86c977f;hp=12c6c813ff0de41f1e0f29c7682b75c27c87af52;hpb=86730c1d88ded8f44d0c5d2e2c7268185aea73ec;p=org.ibex.core.git diff --git a/src/org/xwt/plat/OpenGL.cc b/src/org/xwt/plat/OpenGL.cc index 12c6c81..3c8cf6a 100644 --- a/src/org/xwt/plat/OpenGL.cc +++ b/src/org/xwt/plat/OpenGL.cc @@ -25,7 +25,8 @@ #include -#define min(a,b) (a(b)?(a):(b)) namespace org { namespace xwt { namespace plat { @@ -179,6 +180,8 @@ void OpenGL$RectGLPicture::natInit(Object *data_, jboolean alphaOnly) { } void OpenGL$RectGLPicture::draw(jint dx, jint dy, jint cx1, jint cy1, jint cx2, jint cy2) { + cx1 = max(dx, cx1); + cy1 = max(dy, cy1); cx2 = min(cx2, dx + width); cy2 = min(cy2, dy + height); if (cy2 <= cy1 || cx2 <= cx1) return; @@ -273,6 +276,8 @@ void OpenGL$SquareGLPicture::natInit(Object *data_, jboolean alphaOnly) { } void OpenGL$SquareGLPicture::draw(jint dx, jint dy, jint cx1, jint cy1, jint cx2, jint cy2) { + cx1 = max(dx, cx1); + cy1 = max(dy, cy1); cx2 = min(cx2, dx + width); cy2 = min(cy2, dy + height); if (cy2 <= cy1 || cx2 <= cx1) return;