From 67901f537c928b17c2855d757409795d9a9d5d6b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 1 Oct 2016 13:29:30 -0700 Subject: [PATCH] Fixed bug 3174 - SDL_SetRenderTarget clip rect Marcel Bakker In SDL_SetRenderTarget(), i think the intended behavior was to clear the clip rect when a new target is set. --- src/render/SDL_render.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 097ffa027..4f9b6b248 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1106,6 +1106,8 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) renderer->viewport.y = 0; renderer->viewport.w = texture->w; renderer->viewport.h = texture->h; + SDL_zero(renderer->clip_rect); + renderer->clipping_enabled = SDL_FALSE; renderer->scale.x = 1.0f; renderer->scale.y = 1.0f; renderer->logical_w = texture->w;