From 54ddb400a5dadd41f22ad1cc3c27ae9d84af2030 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Oct 2020 12:07:05 +0200 Subject: [PATCH] - fixed fullscreen scaling for narrow aspect ratios. --- src/common/2d/v_draw.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/2d/v_draw.cpp b/src/common/2d/v_draw.cpp index ef34bbb57d..cdf4413f8e 100644 --- a/src/common/2d/v_draw.cpp +++ b/src/common/2d/v_draw.cpp @@ -350,9 +350,9 @@ void CalcFullscreenScale(DrawParms *parms, double srcwidth, double srcheight, in } double aspect; - if (srcheight == 200) aspect = srcwidth / 240.; - else if (srcheight == 400) aspect = srcwidth / 480; - else aspect = srcwidth / srcheight; + if (srcheight == 200) srcheight = 240.; + else if (srcheight == 400) srcheight = 480; + aspect = srcwidth / srcheight; rect.left = rect.top = 0; auto screenratio = ActiveRatio(GetWidth(), GetHeight()); if (autoaspect == FSMode_ScaleToFit43 || autoaspect == FSMode_ScaleToFit43Top || autoaspect == FSMode_ScaleToFit43Bottom) @@ -366,7 +366,7 @@ void CalcFullscreenScale(DrawParms *parms, double srcwidth, double srcheight, in double width4_3 = srcheight * (4. / 3.); rect.width = (double)GetWidth() * srcwidth / width4_3; rect.height = GetHeight() * screenratio * (3. / 4.); // use 4:3 for the image - rect.left = -(srcwidth - width4_3) / 2; + rect.left = (double)GetWidth() * (-(srcwidth - width4_3) / 2) / width4_3; switch (oautoaspect) { default: