mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-07 18:39:37 +01:00
Fixed divide by zero if setting integer scale without setting logical width and height
This commit is contained in:
parent
e4af8ce968
commit
8e2634eb13
@ -1145,6 +1145,9 @@ UpdateLogicalSize(SDL_Renderer *renderer)
|
|||||||
float scale;
|
float scale;
|
||||||
SDL_Rect viewport;
|
SDL_Rect viewport;
|
||||||
|
|
||||||
|
if (!renderer->logical_w || !renderer->logical_h) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) {
|
if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user