From 51b03f0bf5af5cb6041b454a846061b5a7ff2d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 22 Jul 2016 07:45:52 +0200 Subject: Fix binding for ItemList.sort_items_by_text Also forces to recompute the cached rect for all items. Fixes #5799 --- scene/gui/item_list.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 7d112d1492..2f4f79904d 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1211,8 +1211,11 @@ String ItemList::get_tooltip(const Point2& p_pos) const { } void ItemList::sort_items_by_text() { + items.sort(); update(); + shape_changed=true; + if (select_mode==SELECT_SINGLE) { for(int i=0;i