Fix negative indices in TreeItem
This commit is contained in:
parent
72b5a4335e
commit
5315c9597f
1 changed files with 5 additions and 0 deletions
|
@ -723,7 +723,12 @@ TreeItem *TreeItem::get_next_visible(bool p_wrap) {
|
|||
|
||||
TreeItem *TreeItem::get_child(int p_idx) {
|
||||
_create_children_cache();
|
||||
|
||||
if (p_idx < 0) {
|
||||
p_idx += children_cache.size();
|
||||
}
|
||||
ERR_FAIL_INDEX_V(p_idx, children_cache.size(), nullptr);
|
||||
|
||||
return children_cache.get(p_idx);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue