Fix window resizing

If you made the window square, the screen wouldn't be centered
properly.
This commit is contained in:
Clownacy 2020-04-10 00:45:57 +01:00
parent b6774440b6
commit ba069de70e
2 changed files with 2 additions and 2 deletions

View file

@ -132,7 +132,7 @@ void WindowBackend_Software_HandleWindowResize(unsigned int width, unsigned int
GLsizei viewport_width;
GLsizei viewport_height;
if (width > height)
if ((float)width / (float)height > (float)framebuffer_width / (float)framebuffer_height)
{
viewport_y = 0;
viewport_height = height;

View file

@ -669,7 +669,7 @@ void RenderBackend_DrawScreen(void)
GLsizei width;
GLsizei height;
if (actual_screen_width > actual_screen_height)
if ((float)actual_screen_width / (float)actual_screen_height > (float)framebuffer.width / (float)framebuffer.height)
{
y = 0;
height = actual_screen_height;