Merge branch 'master' into jgrpp

# Conflicts:
#	src/company_gui.cpp
#	src/core/math_func.hpp
#	src/highscore.cpp
#	src/tests/math_func.cpp
This commit is contained in:
Jonathan G Rennison
2023-09-12 18:25:49 +01:00
15 changed files with 164 additions and 116 deletions

View File

@@ -421,11 +421,8 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
scroll = true;
uint avg_height = height / (uint)list.size();
/* Check at least there is space for one item. */
assert(available_height >= avg_height);
/* Fit the list. */
uint rows = available_height / avg_height;
/* Fit the list; create at least one row, even if there is no height available. */
uint rows = std::max<uint>(available_height / avg_height, 1);
height = rows * avg_height;
/* Add space for the scrollbar. */