From 8d24dde49c123331190cce7ab6c30ec9a6c5ffa2 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sun, 31 Dec 2023 04:45:14 +0100 Subject: [PATCH] more maintas tweaks --- src/utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils.c b/src/utils.c index c3c94d5..67665a7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -379,12 +379,15 @@ void util_toggle_maximize() int w = dst_rc.right - dst_rc.left; int h = dst_rc.bottom - dst_rc.top; + double dst_ar = (double)g_ddraw->height / g_ddraw->width; + double src_ar = (double)h / w; + dst_rc.top = 0; dst_rc.left = 0; dst_rc.right = w; - dst_rc.bottom = (LONG)round(((double)g_ddraw->height / g_ddraw->width) * w); + dst_rc.bottom = (LONG)round(dst_ar * w); - if (dst_rc.bottom > h) + if (src_ar < dst_ar) { dst_rc.right = (LONG)round(((double)dst_rc.right / dst_rc.bottom) * h); dst_rc.bottom = h;