mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-08 18:09:45 +01:00
Document menu width limit better
The reason for the menu width to be limited to 272 pixels was rather undocumented in the code, now the comment explains more about it.
This commit is contained in:
parent
46d5fc6576
commit
803d0f45de
1 changed files with 3 additions and 1 deletions
|
@ -7466,7 +7466,9 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
}
|
||||
|
||||
// Automatically center the menu. We must check the width of the menu with the initial horizontal spacing.
|
||||
// If it doesn't fit onscreen (including square brackets), reduce the horizontal spacing by 5 and retry.
|
||||
// If it's too wide, reduce the horizontal spacing by 5 and retry.
|
||||
// Try to limit the menu width to 272 pixels: 320 minus 16*2 for square brackets, minus 8*2 padding.
|
||||
// The square brackets fall outside the menu width (i.e. selected menu options are printed 16 pixels to the left)
|
||||
bool done_once = false;
|
||||
int menuwidth = 0;
|
||||
for (; !done_once || (menuwidth > 272 && menuspacing > 0); maxspacing -= 5)
|
||||
|
|
Loading…
Reference in a new issue