summaryrefslogtreecommitdiffstats
path: root/src/common/framebuffer_layout.cpp
diff options
context:
space:
mode:
authorJames Rowe <jroweboy@gmail.com>2016-11-05 09:58:11 +0100
committerJames Rowe <jroweboy@gmail.com>2016-11-05 10:46:43 +0100
commitd9305b0a074a255eb484911db70a126a6fe347b1 (patch)
treefcd629c513d4c8d217bf89069b288a39debb594f /src/common/framebuffer_layout.cpp
parentRework frame layouts to use a max rectangle instead of hardcoded calculations (diff)
downloadyuzu-d9305b0a074a255eb484911db70a126a6fe347b1.tar
yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.tar.gz
yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.tar.bz2
yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.tar.lz
yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.tar.xz
yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.tar.zst
yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.zip
Diffstat (limited to '')
-rw-r--r--src/common/framebuffer_layout.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/framebuffer_layout.cpp b/src/common/framebuffer_layout.cpp
index d50c141bb..e8538dcfd 100644
--- a/src/common/framebuffer_layout.cpp
+++ b/src/common/framebuffer_layout.cpp
@@ -51,11 +51,15 @@ FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height, bool swapp
bot_screen.TranslateX((screen_window_area.GetWidth() - bot_screen.GetWidth()) / 2);
} else {
// Window is narrower than the emulation content => apply borders to the top and bottom
- top_screen = top_screen.TranslateY(height / 2 - top_screen.GetHeight());
// Recalculate the bottom screen to account for the width difference between top and bottom
screen_window_area = {0, 0, width, top_screen.GetHeight()};
bot_screen = maxRectangle(screen_window_area, BOT_SCREEN_ASPECT_RATIO);
bot_screen = bot_screen.TranslateX((top_screen.GetWidth() - bot_screen.GetWidth()) / 2);
+ if (swapped) {
+ bot_screen = bot_screen.TranslateY(height / 2 - bot_screen.GetHeight());
+ } else {
+ top_screen = top_screen.TranslateY(height / 2 - top_screen.GetHeight());
+ }
}
// Move the top screen to the bottom if we are swapped.
res.top_screen = swapped ? top_screen.TranslateY(height / 2) : top_screen;