Browse Source

Merge pull request #34208 from allkhor/fix_scroll_item_list

Fixed strange behaviour of scroll in the ItemList.
Rémi Verschelde 5 years ago
parent
commit
2c606647df
1 changed files with 2 additions and 2 deletions
  1. 2 2
      scene/gui/item_list.cpp

+ 2 - 2
scene/gui/item_list.cpp

@@ -973,12 +973,12 @@ void ItemList::_notification(int p_what) {
 					float max = MAX(page, ofs.y + max_h);
 					if (auto_height)
 						auto_height_value = ofs.y + max_h + bg->get_minimum_size().height;
+					scroll_bar->set_max(max);
+					scroll_bar->set_page(page);
 					if (max <= page) {
 						scroll_bar->set_value(0);
 						scroll_bar->hide();
 					} else {
-						scroll_bar->set_max(max);
-						scroll_bar->set_page(page);
 						scroll_bar->show();
 
 						if (do_autoscroll_to_bottom)