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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user