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:
parent
d5fc040d2d
commit
728f643ea7
6 changed files with 32 additions and 29 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue