瀏覽代碼

Don't allow to use too big index in ItemList

Rafał Mikrut 5 年之前
父節點
當前提交
724f5f3178
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/item_list.cpp

+ 1 - 1
scene/gui/item_list.cpp

@@ -993,7 +993,7 @@ void ItemList::_notification(int p_what) {
 		}
 
 		//ensure_selected_visible needs to be checked before we draw the list.
-		if (ensure_selected_visible && current >= 0 && current <= items.size()) {
+		if (ensure_selected_visible && current >= 0 && current < items.size()) {
 
 			Rect2 r = items[current].rect_cache;
 			int from = scroll_bar->get_value();