Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't apply gui_scaling & DPI twice to table[] / textlist[] scrollbar #14206

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/gui/guiTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GUITable::GUITable(gui::IGUIEnvironment *env,
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,
core::rect<s32>(RelativeRect.getWidth() - s,
0,
Expand All @@ -77,18 +77,6 @@ GUITable::GUITable(gui::IGUIEnvironment *env,
setTabStop(true);
setTabOrder(-1);
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()
Expand Down