diff options
| author | ShyRed | 2018-04-14 14:36:53 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-04-28 22:43:36 +0200 |
| commit | d89015cfe30a35f8268a88d1e09ccb79570816e7 (patch) | |
| tree | f666cc9a218cde72cf4bf4aae78060514bfe21ae | |
| parent | 826108efecf106522a3412291725069dc35119f8 (diff) | |
| download | godot-d89015cfe30a35f8268a88d1e09ccb79570816e7.tar.gz godot-d89015cfe30a35f8268a88d1e09ccb79570816e7.tar.zst godot-d89015cfe30a35f8268a88d1e09ccb79570816e7.zip | |
ItemList selection: Check against item count
ItemList needs to check against the number of items available when the user moves the selection via "ui_right" action.
(cherry picked from commit cbcb96ae85283b8053d4b731ce7912e50b849791)
| -rw-r--r-- | scene/gui/item_list.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index fe85d0400..c62547965 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -675,7 +675,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { search_string = ""; //any mousepress cancels - if (current % current_columns != (current_columns - 1)) { + if (current % current_columns != (current_columns - 1) && current + 1 < items.size()) { set_current(current + 1); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { |
