diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 0f1dfaa4e00..ea5e0aa9748 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1443,11 +1443,11 @@ void ItemList::_check_shape_changed() { } } - for (int j = items.size() - 1; j >= 0 && col > 0; j--, col--) { - items.write[j].rect_cache.size.y = max_h; - } - if (all_fit) { + for (int j = items.size() - 1; j >= 0 && col > 0; j--, col--) { + items.write[j].rect_cache.size.y = max_h; + } + float page = MAX(0, size.height - theme_cache.panel_style->get_minimum_size().height); float max = MAX(page, ofs.y + max_h); if (auto_height) {