mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
If scaling fails, fall back to the closest image available in SDL_GetSurfaceImage()
This commit is contained in:
parent
0822d94631
commit
41f1c83caa
1 changed files with 3 additions and 1 deletions
|
|
@ -555,7 +555,9 @@ SDL_Surface *SDL_GetSurfaceImage(SDL_Surface *surface, float display_scale)
|
|||
}
|
||||
scaled = next_scaled;
|
||||
if (!scaled) {
|
||||
return NULL;
|
||||
// Failure, fall back to the closest surface
|
||||
++closest->refcount;
|
||||
return closest;
|
||||
}
|
||||
} while (scaled->w != desired_w || scaled->h != desired_h);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue