mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-02-02 07:11:02 +00:00
render: only enable clipping when the rectangle is valid
Fixes https://github.com/libsdl-org/SDL/issues/6896 (cherry picked from commit 00f05dcf49602889733262fc810386592ff51736)
This commit is contained in:
parent
af54c82138
commit
3dbc6a40ae
|
@ -2488,7 +2488,7 @@ int SDL_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
|
|||
int retval;
|
||||
CHECK_RENDERER_MAGIC(renderer, -1)
|
||||
|
||||
if (rect) {
|
||||
if (rect && rect->w > 0 && rect->h > 0) {
|
||||
renderer->clipping_enabled = SDL_TRUE;
|
||||
renderer->clip_rect.x = (double)rect->x * renderer->scale.x;
|
||||
renderer->clip_rect.y = (double)rect->y * renderer->scale.y;
|
||||
|
|
Loading…
Reference in a new issue