fix empty dropdowns

This commit is contained in:
wolfreak99 authored and Michael Steenbeek committed 2017-07-25 10:45:38 +02:00
1 parent 424f2fcef5
commit 150cc90f89
1 file changed
+1
+1
View File
@@ -167,6 +167,7 @@ void window_dropdown_show_text_custom_width(sint32 x, sint32 y, sint32 extray, u
_dropdown_item_height = (flags & DROPDOWN_FLAG_CUSTOM_HEIGHT) ? custom_height : 10;
gDropdownNumItems = (sint32)num_items;
_dropdown_num_columns = (gDropdownNumItems + DROPDOWN_TEXT_MAX_ROWS - 1) / DROPDOWN_TEXT_MAX_ROWS;
_dropdown_num_columns = max(1, _dropdown_num_columns);
_dropdown_num_rows = (gDropdownNumItems + _dropdown_num_columns - 1) / _dropdown_num_columns;
// Text dropdowns are listed horizontally