mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00: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:
parent
e5a37543cc
commit
3b11288989
7 changed files with 58 additions and 15 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue