1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02: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
6 changed files with 32 additions and 29 deletions

View File

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