mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-07 16:01:10 +00:00
Don't render 0 sized texture rectangles
Fixes https://github.com/libsdl-org/sdl2-compat/issues/355
This commit is contained in:
parent
6f3b14a6df
commit
fd4e6d2949
1 changed files with 2 additions and 1 deletions
|
@ -3888,7 +3888,8 @@ bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_F
|
||||||
real_srcrect.w = (float)texture->w;
|
real_srcrect.w = (float)texture->w;
|
||||||
real_srcrect.h = (float)texture->h;
|
real_srcrect.h = (float)texture->h;
|
||||||
if (srcrect) {
|
if (srcrect) {
|
||||||
if (!SDL_GetRectIntersectionFloat(srcrect, &real_srcrect, &real_srcrect)) {
|
if (!SDL_GetRectIntersectionFloat(srcrect, &real_srcrect, &real_srcrect) ||
|
||||||
|
real_srcrect.w == 0.0f || real_srcrect.h == 0.0f) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue