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 - D3D_UpdateClipRect() sets the wrong width for the clip rect
Summary: D3D_UpdateClipRect() sets the wrong width for the clip rect
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.0
Hardware: x86 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-17 07:34 UTC by Bithika Mookherjee
Modified: 2013-07-20 01:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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