From c922762791e474b575ff0738df63add2ebae508d Mon Sep 17 00:00:00 2001 From: Em Date: Wed, 29 Jan 2025 01:13:35 -0500 Subject: [PATCH] proposed fix: set curr_src.h is to bottom_height before drawing bottom edges / corners in SDL_RenderTexture9Grid, to avoid issue where inadvertently using top height if the npatch existed on a larger texture than the drawn edge would cause too many pixels to be included in the bottom part of the render. --- 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 45f3686a31..b6d6db7162 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -4426,6 +4426,7 @@ bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const // Lower-right corner curr_src.y = srcrect->y + srcrect->h - bottom_height; + curr_src.h = bottom_height; curr_dst.y = dstrect->y + dstrect->h - dst_bottom_height; curr_dst.h = dst_bottom_height; if (!SDL_RenderTexture(renderer, texture, &curr_src, &curr_dst)) { @@ -4474,6 +4475,7 @@ bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const // Bottom curr_src.y = srcrect->y + srcrect->h - bottom_height; + curr_src.h = bottom_height; curr_dst.y = dstrect->y + dstrect->h - dst_bottom_height; curr_dst.h = dst_bottom_height; if (!SDL_RenderTexture(renderer, texture, &curr_src, &curr_dst)) {