Procházet zdrojové kódy

Fix ItemList not update when icon scale changes

Haoyu Qiu před 2 roky
rodič
revize
1bf4c12c0a
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      scene/gui/item_list.cpp

+ 7 - 0
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 {