From d6affac72d74e3250c817a19510dcc755b6978ae Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 30 Jul 2017 08:17:54 -0700 Subject: [PATCH] GPU: Correct 1080p/720p crop for ultrawide/similar. If the display is 1280x1080 or 2560x1080, we don't want to stretch width. --- GPU/Common/FramebufferCommon.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index d3ffcb3755..289dfda525 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -72,12 +72,13 @@ void CenterDisplayOutputRect(float *x, float *y, float *w, float *h, float origW return; } } else if (g_Config.iSmallDisplayZoomType == 2) { // Auto Scaling + // Stretch to 1080 for 272*4. But don't distort if not widescreen (i.e. ultrawide of halfwide.) float pixelCrop = frameH / 270.0f; float resCommonWidescreen = pixelCrop - floor(pixelCrop); - if (!rotated && resCommonWidescreen == 0.0f) { - *x = 0; + if (!rotated && resCommonWidescreen == 0.0f && frameW >= pixelCrop * 480.0f) { + *x = floorf((frameW - pixelCrop * 480.0f) * 0.5f); *y = floorf(-pixelCrop); - *w = floorf(frameW); + *w = floorf(pixelCrop * 480.0f); *h = floorf(pixelCrop * 272.0f); return; }