From 1bf4c12c0a66cf2e53d59b120be9d228e3516c5e Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 3 Sep 2023 19:10:24 +0800 Subject: [PATCH] Fix ItemList not update when icon scale changes --- scene/gui/item_list.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 23b516192ec..b03d3c52d27 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1615,7 +1615,14 @@ bool ItemList::get_allow_search() const { void ItemList::set_icon_scale(real_t p_scale) { ERR_FAIL_COND(!Math::is_finite(p_scale)); + + if (icon_scale == p_scale) { + return; + } + icon_scale = p_scale; + queue_redraw(); + shape_changed = true; } real_t ItemList::get_icon_scale() const {