Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug 1977 - D3D_UpdateClipRect() sets the wrong width for the cl…
Browse files Browse the repository at this point in the history
…ip 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;
  • Loading branch information
slouken committed Jul 20, 2013
1 parent 3bdd85e commit 431f429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/render/direct3d/SDL_render_d3d.c
Expand Up @@ -902,7 +902,7 @@ D3D_UpdateClipRect(SDL_Renderer * renderer)
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);
Expand Down

0 comments on commit 431f429

Please sign in to comment.