fix ratio

This commit is contained in:
veclav talica 2024-10-07 20:29:03 +03:00
parent 3c6bcdc499
commit b0e6dd78b2

View File

@ -251,7 +251,7 @@ void render(void) {
/* fit rendering context onto the resizable screen */
if (ctx.game.window_size_has_changed) {
if ((float)ctx.game.window_w / (float)ctx.game.window_h > (float)(ctx.base_render_width / ctx.base_render_height)) {
if ((float)ctx.game.window_w / (float)ctx.game.window_h > (float)ctx.base_render_width / (float)ctx.base_render_height) {
float ratio = (float)ctx.game.window_h / (float)ctx.base_render_height;
int w = (int)((float)ctx.base_render_width * ratio);
setup_viewport(