From ab82f014aea39a8b12df8ad8759933664308c17c Mon Sep 17 00:00:00 2001 From: Clownacy Date: Wed, 8 Jul 2020 16:05:06 +0100 Subject: [PATCH] Avoid some float logic Also shuts up some VS2019 warnings --- src/Backends/Rendering/Window/Software/GLFW3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Backends/Rendering/Window/Software/GLFW3.cpp b/src/Backends/Rendering/Window/Software/GLFW3.cpp index daf6e13f..a6cab986 100644 --- a/src/Backends/Rendering/Window/Software/GLFW3.cpp +++ b/src/Backends/Rendering/Window/Software/GLFW3.cpp @@ -140,7 +140,7 @@ void WindowBackend_Software_HandleWindowResize(unsigned int width, unsigned int viewport_y = 0; viewport_height = height; - viewport_width = framebuffer_width * ((float)height / (float)framebuffer_height); + viewport_width = (framebuffer_width * height) / framebuffer_height; viewport_x = (width - viewport_width) / 2; } else @@ -148,7 +148,7 @@ void WindowBackend_Software_HandleWindowResize(unsigned int width, unsigned int viewport_x = 0; viewport_width = width; - viewport_height = framebuffer_height * ((float)width / (float)framebuffer_width); + viewport_height = (framebuffer_height * width) / framebuffer_width; viewport_y = (height - viewport_height) / 2; }