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

Scale C++ menus down to fit the window (#14690)

This commit is contained in:
grorp 2024-05-24 12:10:46 +02:00 committed by GitHub
parent d5fc040d2d
commit 728f643ea7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 32 additions and 29 deletions

View file

@ -66,13 +66,9 @@ void GUIOpenURLMenu::regenerateGui(v2u32 screensize)
/*
Calculate new sizes and positions
*/
const float s = m_gui_scale;
DesiredRect = core::rect<s32>(
screensize.X / 2 - 580 * s / 2,
screensize.Y / 2 - 250 * s / 2,
screensize.X / 2 + 580 * s / 2,
screensize.Y / 2 + 250 * s / 2
);
ScalingInfo info = getScalingInfo(screensize, v2u32(580, 250));
const float s = info.scale;
DesiredRect = info.rect;
recalculateAbsolutePosition(false);
v2s32 size = DesiredRect.getSize();