@@ -4287,7 +4287,6 @@ static bool SDL_RenderTextureTiled_Iterate(SDL_Renderer *renderer, SDL_Texture *
4287
4287
bool SDL_RenderTextureTiled (SDL_Renderer * renderer , SDL_Texture * texture , const SDL_FRect * srcrect , float scale , const SDL_FRect * dstrect )
4288
4288
{
4289
4289
SDL_FRect real_srcrect ;
4290
- SDL_FRect real_dstrect ;
4291
4290
4292
4291
CHECK_RENDERER_MAGIC (renderer , false);
4293
4292
CHECK_TEXTURE_MAGIC (texture , false);
@@ -4317,12 +4316,10 @@ bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const
4317
4316
}
4318
4317
}
4319
4318
4320
- GetRenderViewportSize (renderer , & real_dstrect );
4321
- if (dstrect ) {
4322
- if (!SDL_HasRectIntersectionFloat (dstrect , & real_dstrect )) {
4323
- return true;
4324
- }
4325
- real_dstrect = * dstrect ;
4319
+ SDL_FRect full_dstrect ;
4320
+ if (!dstrect ) {
4321
+ GetRenderViewportSize (renderer , & full_dstrect );
4322
+ dstrect = & full_dstrect ;
4326
4323
}
4327
4324
4328
4325
if (texture -> native ) {
@@ -4336,9 +4333,9 @@ bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const
4336
4333
(!srcrect ||
4337
4334
(real_srcrect .x == 0.0f && real_srcrect .y == 0.0f &&
4338
4335
real_srcrect .w == (float )texture -> w && real_srcrect .h == (float )texture -> h ))) {
4339
- return SDL_RenderTextureTiled_Wrap (renderer , texture , & real_srcrect , scale , & real_dstrect );
4336
+ return SDL_RenderTextureTiled_Wrap (renderer , texture , & real_srcrect , scale , dstrect );
4340
4337
} else {
4341
- return SDL_RenderTextureTiled_Iterate (renderer , texture , & real_srcrect , scale , & real_dstrect );
4338
+ return SDL_RenderTextureTiled_Iterate (renderer , texture , & real_srcrect , scale , dstrect );
4342
4339
}
4343
4340
}
4344
4341
0 commit comments