Fixed clip rectangle calculation when there is a viewport offset

This commit is contained in:
Sam Lantinga 2015-05-28 18:57:10 -07:00
parent 2a4efa3b11
commit d727fa668a
5 changed files with 57 additions and 14 deletions

View file

@ -1269,10 +1269,10 @@ D3D_UpdateClipRect(SDL_Renderer * renderer)
HRESULT result;
IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, TRUE);
r.left = rect->x;
r.top = rect->y;
r.right = rect->x + rect->w;
r.bottom = rect->y + rect->h;
r.left = renderer->viewport.x + rect->x;
r.top = renderer->viewport.y + rect->y;
r.right = renderer->viewport.x + rect->x + rect->w;
r.bottom = renderer->viewport.y + rect->y + rect->h;
result = IDirect3DDevice9_SetScissorRect(data->device, &r);
if (result != D3D_OK) {