From 6e1a873e57a126bbff62f0383953715dc56b383e Mon Sep 17 00:00:00 2001
From: Vitor Kiguchi <vitor-kiguchi@hotmail.com>
Date: Sat, 18 Jan 2020 18:57:13 -0300
Subject: [PATCH] use the defined constants instead of magic numbers for screen
 dimensions

---
 src/core/frontend/emu_window.cpp | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp
index d35255117..641512891 100644
--- a/src/core/frontend/emu_window.cpp
+++ b/src/core/frontend/emu_window.cpp
@@ -4,6 +4,7 @@
 
 #include <cmath>
 #include <mutex>
+#include "core/3ds.h"
 #include "core/frontend/emu_window.h"
 #include "core/frontend/input.h"
 #include "core/settings.h"
@@ -45,7 +46,7 @@ private:
 
 EmuWindow::EmuWindow() {
     // TODO: Find a better place to set this.
-    config.min_client_area_size = std::make_pair(400u, 480u);
+    config.min_client_area_size = std::make_pair(Core::kScreenTopWidth, Core::kScreenTopHeight + Core::kScreenBottomHeight);
     active_config = config;
     touch_state = std::make_shared<TouchState>();
     Input::RegisterFactory<Input::TouchDevice>("emu_window", touch_state);
@@ -153,27 +154,27 @@ void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height)
         case Settings::LayoutOption::SingleScreen:
             layout = Layout::SingleFrameLayout(width, height, Settings::values.swap_screen,
                                                Settings::values.upright_screen);
-            min_width = Settings::values.swap_screen ? 320u : 400u;
-            min_height = 240u;
+            min_width = Settings::values.swap_screen ? Core::kScreenBottomWidth : Core::kScreenTopWidth;
+            min_height = Core::kScreenBottomHeight;
             break;
         case Settings::LayoutOption::LargeScreen:
             layout = Layout::LargeFrameLayout(width, height, Settings::values.swap_screen,
                                               Settings::values.upright_screen);
-            min_width = Settings::values.swap_screen ? 420u : 480u;
-            min_height = 240u;
+            min_width = Settings::values.swap_screen ? Core::kScreenTopWidth/4 + Core::kScreenBottomWidth : Core::kScreenTopWidth + Core::kScreenBottomWidth/4;
+            min_height = Core::kScreenBottomHeight;
             break;
         case Settings::LayoutOption::SideScreen:
             layout = Layout::SideFrameLayout(width, height, Settings::values.swap_screen,
                                              Settings::values.upright_screen);
-            min_width = 720u;
-            min_height = 240u;
+            min_width = Core::kScreenTopWidth + Core::kScreenBottomWidth;
+            min_height = Core::kScreenBottomHeight;
             break;
         case Settings::LayoutOption::Default:
         default:
             layout = Layout::DefaultFrameLayout(width, height, Settings::values.swap_screen,
                                                 Settings::values.upright_screen);
-            min_width = 400u;
-            min_height = 480u;
+            min_width = Core::kScreenTopWidth;
+            min_height = Core::kScreenTopHeight + Core::kScreenBottomHeight;
             break;
         }
         if(Settings::values.upright_screen){