If the viewport changes the cliprect should be updated

The clip rectangle is defined to be viewport relative, so if the viewport changes we need to update it.

Fixes https://github.com/libsdl-org/SDL/issues/9094

(cherry picked from commit d0af01e7d4)
(cherry picked from commit 05f6709617)
This commit is contained in:
Sam Lantinga
2024-02-25 09:37:56 -08:00
parent b48106f8a8
commit 54adba6a31
8 changed files with 8 additions and 0 deletions

View File

@@ -1170,6 +1170,7 @@ static int D3D_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) {
SDL_copyp(viewport, &cmd->data.viewport.rect);
data->drawstate.viewport_dirty = SDL_TRUE;
data->drawstate.cliprect_dirty = SDL_TRUE;
}
break;
}