aboutsummaryrefslogtreecommitdiff
path: root/src/gui/modalMenu.cpp
diff options
context:
space:
mode:
authorstujones11 <stujones111@gmail.com>2018-11-26 21:55:24 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-11-26 22:55:24 +0100
commit9519d57017cfa28eb4f2fbf3c780f826017bbb00 (patch)
tree2e6d55e1f5c0acb74028c0e5ebfe69b631b1ffdd /src/gui/modalMenu.cpp
parent8ba64e43fe69ecdf31ded0b5aeee625fcc08168a (diff)
downloadminetest-9519d57017cfa28eb4f2fbf3c780f826017bbb00.tar.gz
minetest-9519d57017cfa28eb4f2fbf3c780f826017bbb00.tar.bz2
minetest-9519d57017cfa28eb4f2fbf3c780f826017bbb00.zip
Make non-formspec modal menus respect gui scale (#7850)
Diffstat (limited to 'src/gui/modalMenu.cpp')
-rw-r--r--src/gui/modalMenu.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/modalMenu.cpp b/src/gui/modalMenu.cpp
index d8df2540c..4ffe88800 100644
--- a/src/gui/modalMenu.cpp
+++ b/src/gui/modalMenu.cpp
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "modalMenu.h"
#include "gettext.h"
#include "porting.h"
+#include "settings.h"
#ifdef HAVE_TOUCHSCREENGUI
#include "touchscreengui.h"
@@ -37,6 +38,11 @@ GUIModalMenu::GUIModalMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
#endif
m_menumgr(menumgr)
{
+ m_gui_scale = g_settings->getFloat("gui_scaling");
+#ifdef __ANDROID__
+ float d = porting::getDisplayDensity();
+ m_gui_scale *= 1.1 - 0.3 * d + 0.2 * d * d;
+#endif
setVisible(true);
Environment->setFocus(this);
m_menumgr->createdMenu(this);