Jelajahi Sumber

SDL_GetRectIntersectionFloat(): Allow rendering zero-sized srcrect

(cherry picked from commit 27b256022b7e0ba01923bb24ff0938ea613d13b7)
Petar Popovic 4 bulan lalu
induk
melakukan
0834f1d6ce
1 mengubah file dengan 1 tambahan dan 2 penghapusan
  1. 1 2
      src/render/SDL_render.c

+ 1 - 2
src/render/SDL_render.c

@@ -3931,8 +3931,7 @@ bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_F
     real_srcrect.w = (float)texture->w;
     real_srcrect.h = (float)texture->h;
     if (srcrect) {
-        if (!SDL_GetRectIntersectionFloat(srcrect, &real_srcrect, &real_srcrect) ||
-            real_srcrect.w == 0.0f || real_srcrect.h == 0.0f) {
+        if (!SDL_GetRectIntersectionFloat(srcrect, &real_srcrect, &real_srcrect)) {
             return true;
         }
     }