Fixed bug 1977 - D3D_UpdateClipRect() sets the wrong width for the clip rect
authorSam Lantinga <slouken@libsdl.org>
Fri, 19 Jul 2013 22:43:14 -0700
changeset 7472 0ec51bd57d56
parent 7471 75726efbf679
child 7473 c99dc5a423f2
Fixed bug 1977 - D3D_UpdateClipRect() sets the wrong width for the clip rect Bithika Mookherjee SDL_RenderSetClipRect() calls into renderer->UpdateClipRect(renderer). I am not sure if UpdateClipRect() can point to a number of clip rect update functions, but on my platform it calls D3D_UpdateClipRect(). In that function, the rect to pass to IDirect3DDevice9_SetScissorRect() has it's right field set as: r.right = rect->w + rect->w; But actually, this should be: r.right = rect->x + rect->w;
src/render/direct3d/SDL_render_d3d.c
--- a/src/render/direct3d/SDL_render_d3d.c	Fri Jul 19 00:22:57 2013 -0400
+++ b/src/render/direct3d/SDL_render_d3d.c	Fri Jul 19 22:43:14 2013 -0700
@@ -902,7 +902,7 @@
         IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, TRUE);
         r.left = rect->x;
         r.top = rect->y;
-        r.right = rect->w + rect->w;
+        r.right = rect->x + rect->w;
         r.bottom = rect->y + rect->h;
 
         result = IDirect3DDevice9_SetScissorRect(data->device, &r);