mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Don't apply gui_scaling & DPI twice to table[] / textlist[] scrollbar (#14206)
This commit is contained in:
parent
c9cd0d20ef
commit
995c192874
@ -60,7 +60,7 @@ GUITable::GUITable(gui::IGUIEnvironment *env,
|
|||||||
m_rowheight = MYMAX(m_rowheight, 1);
|
m_rowheight = MYMAX(m_rowheight, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const s32 s = skin->getSize(gui::EGDS_SCROLLBAR_SIZE);
|
const s32 s = skin->getSize(gui::EGDS_SCROLLBAR_SIZE) * 1.5f;
|
||||||
m_scrollbar = new GUIScrollBar(Environment, this, -1,
|
m_scrollbar = new GUIScrollBar(Environment, this, -1,
|
||||||
core::rect<s32>(RelativeRect.getWidth() - s,
|
core::rect<s32>(RelativeRect.getWidth() - s,
|
||||||
0,
|
0,
|
||||||
@ -77,18 +77,6 @@ GUITable::GUITable(gui::IGUIEnvironment *env,
|
|||||||
setTabStop(true);
|
setTabStop(true);
|
||||||
setTabOrder(-1);
|
setTabOrder(-1);
|
||||||
updateAbsolutePosition();
|
updateAbsolutePosition();
|
||||||
#ifdef HAVE_TOUCHSCREENGUI
|
|
||||||
float density = 1; // dp scaling is applied by the skin
|
|
||||||
#else
|
|
||||||
float density = RenderingEngine::getDisplayDensity();
|
|
||||||
#endif
|
|
||||||
core::rect<s32> relative_rect = m_scrollbar->getRelativePosition();
|
|
||||||
s32 width = (relative_rect.getWidth() / (2.0 / 3.0)) * density *
|
|
||||||
g_settings->getFloat("gui_scaling", 0.5f, 20.0f);
|
|
||||||
m_scrollbar->setRelativePosition(core::rect<s32>(
|
|
||||||
relative_rect.LowerRightCorner.X-width,relative_rect.UpperLeftCorner.Y,
|
|
||||||
relative_rect.LowerRightCorner.X,relative_rect.LowerRightCorner.Y
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GUITable::~GUITable()
|
GUITable::~GUITable()
|
||||||
|
Loading…
Reference in New Issue
Block a user