We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1977

Summary: D3D_UpdateClipRect() sets the wrong width for the clip rect
Product: SDL Reporter: Bithika Mookherjee <bithika.mookherjee>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: Windows 7   

Description Bithika Mookherjee 2013-07-17 07:34:21 UTC
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;

i.e. the right coord of the rectangle should be x + width, ( not width + width ).

I've made that change locally and rebuilt the libs, and it works for me.
Comment 1 Sam Lantinga 2013-07-20 01:43:46 UTC
Nice catch, thanks!
http://hg.libsdl.org/SDL/rev/0ec51bd57d56