aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiTable.cpp
diff options
context:
space:
mode:
authorstujones11 <stujones111@gmail.com>2018-11-18 10:31:19 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-11-18 11:31:19 +0100
commit3b112889892f6652d4e80d97e45131f179b1fbe4 (patch)
tree98033eb2cab0639aefc00244411dad94cb9d4c10 /src/gui/guiTable.cpp
parente5a37543cc7932f6252a086b4b8619b5dde9ae5a (diff)
downloadhax-minetest-server-3b112889892f6652d4e80d97e45131f179b1fbe4.tar.gz
hax-minetest-server-3b112889892f6652d4e80d97e45131f179b1fbe4.zip
Android: Improve UI scaling on smaller high-density displays (#7834)
* Android: Improve UI scaling on smaller high-density displays
Diffstat (limited to 'src/gui/guiTable.cpp')
-rw-r--r--src/gui/guiTable.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/guiTable.cpp b/src/gui/guiTable.cpp
index 501b425f8..b1a027e9b 100644
--- a/src/gui/guiTable.cpp
+++ b/src/gui/guiTable.cpp
@@ -78,10 +78,12 @@ GUITable::GUITable(gui::IGUIEnvironment *env,
setTabStop(true);
setTabOrder(-1);
updateAbsolutePosition();
-
+ float density = RenderingEngine::getDisplayDensity();
+#ifdef __ANDROID__
+ density = 1; // dp scaling is applied by the skin
+#endif
core::rect<s32> relative_rect = m_scrollbar->getRelativePosition();
- s32 width = (relative_rect.getWidth()/(2.0/3.0)) *
- RenderingEngine::getDisplayDensity() *
+ s32 width = (relative_rect.getWidth() / (2.0 / 3.0)) * density *
g_settings->getFloat("gui_scaling");
m_scrollbar->setRelativePosition(core::rect<s32>(
relative_rect.LowerRightCorner.X-width,relative_rect.UpperLeftCorner.Y,