From dfdf330722fca45104cf69d161d1a724204e356d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 12 Apr 2022 00:30:43 +0200 Subject: [PATCH] - make menu scale adjustments for ultra-wide aspect ratios. --- src/common/rendering/v_video.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/rendering/v_video.cpp b/src/common/rendering/v_video.cpp index 277144aa8..952fa722c 100644 --- a/src/common/rendering/v_video.cpp +++ b/src/common/rendering/v_video.cpp @@ -281,6 +281,12 @@ void V_UpdateModeSize (int width, int height) CleanHeight = screen->GetHeight() / CleanYfac; int w = screen->GetWidth(); + int h = screen->GetHeight(); + + // clamp screen aspect ratio to 17:10, for anything wider the width will be reduced + double aspect = (double)w / h; + if (aspect > 1.7) w = int(w * 1.7 / aspect); + int factor; if (w < 640) factor = 1; else if (w >= 1024 && w < 1280) factor = 2;