From ad543757bee23838b7f1a58bd1eca6192a37af5e Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 11 Apr 2017 00:00:16 +0200 Subject: [PATCH 1/1] fixed calculating window size percentage after resizing --- src/events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events.c b/src/events.c index e2d5ab9b..25d243b7 100644 --- a/src/events.c +++ b/src/events.c @@ -532,8 +532,8 @@ void HandleWindowEvent(WindowEvent *event) if (new_window_width != video.window_width || new_window_height != video.window_height) { - int new_xpercent = (100 * new_window_width / video.screen_width); - int new_ypercent = (100 * new_window_height / video.screen_height); + int new_xpercent = 100.0 * new_window_width / video.screen_width + .5; + int new_ypercent = 100.0 * new_window_height / video.screen_height + .5; // (extreme window scaling allowed, but cannot be saved permanently) video.window_scaling_percent = MIN(new_xpercent, new_ypercent); -- 2.34.1