Skip to content

Commit

Permalink
Add minimum options menu height
Browse files Browse the repository at this point in the history
This fixes the layout for menus with a smaller number
of items, such as the new Gyro options menu, for which
the title graphic would be rendered below the usual
position
  • Loading branch information
andrei-drexler committed Dec 27, 2023
1 parent 0113a53 commit 45b039a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Quake/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3346,6 +3346,9 @@ static void M_Options_UpdateLayout (void)
optionsmenu.yofs = 0;

height = OPTIONS_LISTOFS + optionsmenu.yofs + optionsmenu.list.numitems * 8;
// Enforce a minimum height, so that if the number of items is relatively small
// the title pic doesn't get drawn below its usual position
height = q_max (height, 192);
if (height <= m_height)
{
optionsmenu.y = (m_top + (m_height - height) / 2) & ~7;
Expand Down

0 comments on commit 45b039a

Please sign in to comment.