diff options
| author | 2016-11-05 02:58:11 -0600 | |
|---|---|---|
| committer | 2016-11-05 03:46:43 -0600 | |
| commit | d9305b0a074a255eb484911db70a126a6fe347b1 (patch) | |
| tree | fcd629c513d4c8d217bf89069b288a39debb594f /src/common/framebuffer_layout.cpp | |
| parent | Rework frame layouts to use a max rectangle instead of hardcoded calculations (diff) | |
| download | yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.tar.gz yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.tar.xz yuzu-d9305b0a074a255eb484911db70a126a6fe347b1.zip | |
Add default hotkey to swap primary screens.
Also minor style changes
Diffstat (limited to 'src/common/framebuffer_layout.cpp')
| -rw-r--r-- | src/common/framebuffer_layout.cpp | 6 |
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 | |||
| 51 | bot_screen.TranslateX((screen_window_area.GetWidth() - bot_screen.GetWidth()) / 2); | 51 | bot_screen.TranslateX((screen_window_area.GetWidth() - bot_screen.GetWidth()) / 2); |
| 52 | } else { | 52 | } else { |
| 53 | // Window is narrower than the emulation content => apply borders to the top and bottom | 53 | // Window is narrower than the emulation content => apply borders to the top and bottom |
| 54 | top_screen = top_screen.TranslateY(height / 2 - top_screen.GetHeight()); | ||
| 55 | // Recalculate the bottom screen to account for the width difference between top and bottom | 54 | // Recalculate the bottom screen to account for the width difference between top and bottom |
| 56 | screen_window_area = {0, 0, width, top_screen.GetHeight()}; | 55 | screen_window_area = {0, 0, width, top_screen.GetHeight()}; |
| 57 | bot_screen = maxRectangle(screen_window_area, BOT_SCREEN_ASPECT_RATIO); | 56 | bot_screen = maxRectangle(screen_window_area, BOT_SCREEN_ASPECT_RATIO); |
| 58 | bot_screen = bot_screen.TranslateX((top_screen.GetWidth() - bot_screen.GetWidth()) / 2); | 57 | bot_screen = bot_screen.TranslateX((top_screen.GetWidth() - bot_screen.GetWidth()) / 2); |
| 58 | if (swapped) { | ||
| 59 | bot_screen = bot_screen.TranslateY(height / 2 - bot_screen.GetHeight()); | ||
| 60 | } else { | ||
| 61 | top_screen = top_screen.TranslateY(height / 2 - top_screen.GetHeight()); | ||
| 62 | } | ||
| 59 | } | 63 | } |
| 60 | // Move the top screen to the bottom if we are swapped. | 64 | // Move the top screen to the bottom if we are swapped. |
| 61 | res.top_screen = swapped ? top_screen.TranslateY(height / 2) : top_screen; | 65 | res.top_screen = swapped ? top_screen.TranslateY(height / 2) : top_screen; |