Remove enable_touch special case for C++ menu scaling (#14800)

This commit is contained in:
grorp 2024-06-30 20:39:36 +02:00 committed by GitHub
parent 7709d92289
commit 3958c19f83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -59,14 +59,8 @@ GUIModalMenu::GUIModalMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
m_menumgr(menumgr), m_menumgr(menumgr),
m_remap_click_outside(remap_click_outside) m_remap_click_outside(remap_click_outside)
{ {
m_gui_scale = std::max(g_settings->getFloat("gui_scaling"), 0.5f); m_gui_scale = g_settings->getFloat("gui_scaling", 0.5f, 20.0f) *
const float screen_dpi_scale = RenderingEngine::getDisplayDensity(); RenderingEngine::getDisplayDensity();
if (g_settings->getBool("enable_touch")) {
m_gui_scale *= 1.1f - 0.3f * screen_dpi_scale + 0.2f * screen_dpi_scale * screen_dpi_scale;
} else {
m_gui_scale *= screen_dpi_scale;
}
setVisible(true); setVisible(true);
m_menumgr->createdMenu(this); m_menumgr->createdMenu(this);