fix ratio
This commit is contained in:
parent
3c6bcdc499
commit
b0e6dd78b2
@ -251,7 +251,7 @@ void render(void) {
|
|||||||
|
|
||||||
/* fit rendering context onto the resizable screen */
|
/* fit rendering context onto the resizable screen */
|
||||||
if (ctx.game.window_size_has_changed) {
|
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;
|
float ratio = (float)ctx.game.window_h / (float)ctx.base_render_height;
|
||||||
int w = (int)((float)ctx.base_render_width * ratio);
|
int w = (int)((float)ctx.base_render_width * ratio);
|
||||||
setup_viewport(
|
setup_viewport(
|
||||||
|
Loading…
Reference in New Issue
Block a user