Explorar o código

Fix ItemList not update when icon scale changes

(cherry picked from commit 1bf4c12c0a66cf2e53d59b120be9d228e3516c5e)
Haoyu Qiu %!s(int64=2) %!d(string=hai) anos
pai
achega
9dfb3ddad5
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      scene/gui/item_list.cpp

+ 7 - 0
scene/gui/item_list.cpp

@@ -1603,7 +1603,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 {