From 995c19287468a5733956fdba028f940901d4d1d5 Mon Sep 17 00:00:00 2001 From: grorp Date: Wed, 3 Jan 2024 21:58:58 +0100 Subject: [PATCH] Don't apply gui_scaling & DPI twice to table[] / textlist[] scrollbar (#14206) --- src/gui/guiTable.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/gui/guiTable.cpp b/src/gui/guiTable.cpp index b5042802a..d84107450 100644 --- a/src/gui/guiTable.cpp +++ b/src/gui/guiTable.cpp @@ -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(RelativeRect.getWidth() - s, 0, @@ -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 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( - relative_rect.LowerRightCorner.X-width,relative_rect.UpperLeftCorner.Y, - relative_rect.LowerRightCorner.X,relative_rect.LowerRightCorner.Y - )); } GUITable::~GUITable()