From 2867a36bdaca3c6d0ed41c6b25e5458abea523d8 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 25 Jul 2010 06:14:44 +0000 Subject: [PATCH] PROPERLY handle roundoff errors in drawsetcliparea git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10359 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gl_draw.c b/gl_draw.c index af704ea3..16eb6069 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -1921,8 +1921,8 @@ void DrawQ_SetClipArea(float x, float y, float width, float height) // OGL uses top to bottom ix = (int)(0.5 + x * ((float)vid.width / vid_conwidth.integer)); iy = (int)(0.5 + y * ((float) vid.height / vid_conheight.integer)); - iw = (int)(width * ((float)vid.width / vid_conwidth.integer)); - ih = (int)(height * ((float)vid.height / vid_conheight.integer)); + iw = (int)(0.5 + (x+width) * ((float)vid.width / vid_conwidth.integer)) - ix; + ih = (int)(0.5 + (y+height) * ((float) vid.height / vid_conheight.integer)) - iy; GL_Scissor(ix, vid.height - iy - ih, iw, ih); GL_ScissorTest(true); -- 2.39.2