1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Allow toggling touchscreen mode at runtime (#14075)

Signed-off-by: David Heidelberg <david@ixit.cz>
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
This commit is contained in:
David Heidelberg 2024-02-22 16:44:49 +01:00 committed by GitHub
parent e3cc26cb7c
commit 34286d77c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 175 additions and 220 deletions

View file

@ -25,10 +25,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <IGUIStaticText.h>
#include <IGUIFont.h>
#ifdef HAVE_TOUCHSCREENGUI
#include "client/renderingengine.h"
#endif
#include "porting.h"
#include "gettext.h"
@ -66,11 +62,8 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
/*
Calculate new sizes and positions
*/
#ifdef HAVE_TOUCHSCREENGUI
const float s = m_gui_scale * RenderingEngine::getDisplayDensity() / 2;
#else
const float s = m_gui_scale;
#endif
DesiredRect = core::rect<s32>(
screensize.X / 2 - 580 * s / 2,
screensize.Y / 2 - 300 * s / 2,