summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/framebuffer_layout.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-10-13 14:10:50 +0200
committerLioncash <mathew1800@gmail.com>2020-10-13 19:16:49 +0200
commit39c8d18feba8eafcd43fbb55e73ae150a1947aad (patch)
tree9565ff464bbb9e5a0aa66e6e310098314e88d019 /src/core/frontend/framebuffer_layout.cpp
parentMerge pull request #3929 from FearlessTobi/ticket-keys (diff)
downloadyuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.tar
yuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.tar.gz
yuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.tar.bz2
yuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.tar.lz
yuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.tar.xz
yuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.tar.zst
yuzu-39c8d18feba8eafcd43fbb55e73ae150a1947aad.zip
Diffstat (limited to 'src/core/frontend/framebuffer_layout.cpp')
-rw-r--r--src/core/frontend/framebuffer_layout.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp
index c1fbc235b..1acc82497 100644
--- a/src/core/frontend/framebuffer_layout.cpp
+++ b/src/core/frontend/framebuffer_layout.cpp
@@ -14,8 +14,8 @@ namespace Layout {
template <class T>
static Common::Rectangle<T> MaxRectangle(Common::Rectangle<T> window_area,
float screen_aspect_ratio) {
- float scale = std::min(static_cast<float>(window_area.GetWidth()),
- window_area.GetHeight() / screen_aspect_ratio);
+ const float scale = std::min(static_cast<float>(window_area.GetWidth()),
+ static_cast<float>(window_area.GetHeight()) / screen_aspect_ratio);
return Common::Rectangle<T>{0, 0, static_cast<T>(std::round(scale)),
static_cast<T>(std::round(scale * screen_aspect_ratio))};
}
@@ -27,7 +27,7 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) {
// so just calculate them both even if the other isn't showing.
FramebufferLayout res{width, height, false, {}};
- const float window_aspect_ratio = static_cast<float>(height) / width;
+ const float window_aspect_ratio = static_cast<float>(height) / static_cast<float>(width);
const float emulation_aspect_ratio = EmulationAspectRatio(
static_cast<AspectRatio>(Settings::values.aspect_ratio.GetValue()), window_aspect_ratio);