mirror of
https://github.com/yawut/SDL.git
synced 2026-11-12 13:24:10 -06:00
Fixed clip rectangle calculation when there is a viewport offset
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user