mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Android: Improve UI scaling on smaller high-density displays (#7834)
* Android: Improve UI scaling on smaller high-density displays
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user