From 5dabc4d72fdcabca54fa9588d82695331c877fff Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Mon, 28 Dec 2020 18:17:25 +0100 Subject: [PATCH] Revert changeset 14590 544ac819e8b3 , does not fully fix --- src/render/SDL_render.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 7e555652d..e80cf6c01 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -2999,25 +2999,24 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, SDL_RenderGetViewport(renderer, &r); real_dstrect.x = 0.0f; real_dstrect.y = 0.0f; - real_dstrect.w = (float) r.w * renderer->scale.x; - real_dstrect.h = (float) r.h * renderer->scale.y; + real_dstrect.w = (float) r.w; + real_dstrect.h = (float) r.h; if (dstrect) { - SDL_FRect dstrect_scaled; - dstrect_scaled.x = dstrect->x * renderer->scale.x; - dstrect_scaled.y = dstrect->y * renderer->scale.y; - dstrect_scaled.w = dstrect->w * renderer->scale.x; - dstrect_scaled.h = dstrect->h * renderer->scale.y; - - if (!SDL_HasIntersectionF(&dstrect_scaled, &real_dstrect)) { + if (!SDL_HasIntersectionF(dstrect, &real_dstrect)) { return 0; } - real_dstrect = dstrect_scaled; + real_dstrect = *dstrect; } if (texture->native) { texture = texture->native; } + real_dstrect.x *= renderer->scale.x; + real_dstrect.y *= renderer->scale.y; + real_dstrect.w *= renderer->scale.x; + real_dstrect.h *= renderer->scale.y; + texture->last_command_generation = renderer->render_command_generation; retval = QueueCmdCopy(renderer, texture, &real_srcrect, &real_dstrect);