From: Holger Schemel Date: Mon, 10 Apr 2017 22:00:16 +0000 (+0200) Subject: fixed calculating window size percentage after resizing X-Git-Tag: 4.0.1.0~52 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ad543757bee23838b7f1a58bd1eca6192a37af5e;p=rocksndiamonds.git fixed calculating window size percentage after resizing --- 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);