Skip to content

Commit c922762

Browse files
l-t-m-fslouken
authored andcommitted
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.
1 parent 235022f commit c922762

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/render/SDL_render.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4426,6 +4426,7 @@ bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const
44264426

44274427
// Lower-right corner
44284428
curr_src.y = srcrect->y + srcrect->h - bottom_height;
4429+
curr_src.h = bottom_height;
44294430
curr_dst.y = dstrect->y + dstrect->h - dst_bottom_height;
44304431
curr_dst.h = dst_bottom_height;
44314432
if (!SDL_RenderTexture(renderer, texture, &curr_src, &curr_dst)) {
@@ -4474,6 +4475,7 @@ bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const
44744475

44754476
// Bottom
44764477
curr_src.y = srcrect->y + srcrect->h - bottom_height;
4478+
curr_src.h = bottom_height;
44774479
curr_dst.y = dstrect->y + dstrect->h - dst_bottom_height;
44784480
curr_dst.h = dst_bottom_height;
44794481
if (!SDL_RenderTexture(renderer, texture, &curr_src, &curr_dst)) {

0 commit comments

Comments
 (0)