瀏覽代碼

Label: update min size when regenerate wordcache

Poommetee Ketson 8 年之前
父節點
當前提交
f471afa4a5
共有 2 個文件被更改,包括 1 次插入7 次删除
  1. 0 1
      editor/editor_about.cpp
  2. 1 6
      scene/gui/label.cpp

+ 0 - 1
editor/editor_about.cpp

@@ -137,7 +137,6 @@ EditorAbout::EditorAbout() {
 	tc->add_child(license_thirdparty);
 	tc->add_child(license_thirdparty);
 
 
 	Label *tpl_label = memnew(Label);
 	Label *tpl_label = memnew(Label);
-	tpl_label->set_custom_minimum_size(Size2(0, 64 * EDSCALE));
 	tpl_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
 	tpl_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
 	tpl_label->set_autowrap(true);
 	tpl_label->set_autowrap(true);
 	tpl_label->set_text(TTR("Godot Engine relies on a number of thirdparty free and open source libraries, all compatible with the terms of its MIT license. The following is an exhaustive list of all such thirdparty components with their respective copyright statements and license terms."));
 	tpl_label->set_text(TTR("Godot Engine relies on a number of thirdparty free and open source libraries, all compatible with the terms of its MIT license. The following is an exhaustive list of all such thirdparty components with their respective copyright statements and license terms."));

+ 1 - 6
scene/gui/label.cpp

@@ -36,7 +36,6 @@ void Label::set_autowrap(bool p_autowrap) {
 
 
 	autowrap = p_autowrap;
 	autowrap = p_autowrap;
 	word_cache_dirty = true;
 	word_cache_dirty = true;
-	minimum_size_changed();
 	update();
 	update();
 }
 }
 bool Label::has_autowrap() const {
 bool Label::has_autowrap() const {
@@ -48,7 +47,6 @@ void Label::set_uppercase(bool p_uppercase) {
 
 
 	uppercase = p_uppercase;
 	uppercase = p_uppercase;
 	word_cache_dirty = true;
 	word_cache_dirty = true;
-	minimum_size_changed();
 	update();
 	update();
 }
 }
 bool Label::is_uppercase() const {
 bool Label::is_uppercase() const {
@@ -71,7 +69,6 @@ void Label::_notification(int p_what) {
 		xl_text = new_text;
 		xl_text = new_text;
 
 
 		regenerate_word_cache();
 		regenerate_word_cache();
-		minimum_size_changed();
 		update();
 		update();
 	}
 	}
 
 
@@ -496,6 +493,7 @@ void Label::regenerate_word_cache() {
 		minsize.height = (font->get_height() * line_count) + (line_spacing * (line_count - 1));
 		minsize.height = (font->get_height() * line_count) + (line_spacing * (line_count - 1));
 	}
 	}
 
 
+	minimum_size_changed();
 	word_cache_dirty = false;
 	word_cache_dirty = false;
 }
 }
 
 
@@ -533,9 +531,6 @@ void Label::set_text(const String &p_string) {
 	if (percent_visible < 1)
 	if (percent_visible < 1)
 		visible_chars = get_total_character_count() * percent_visible;
 		visible_chars = get_total_character_count() * percent_visible;
 	update();
 	update();
-	if (!autowrap) {
-		minimum_size_changed();
-	}
 }
 }
 
 
 void Label::set_clip_text(bool p_clip) {
 void Label::set_clip_text(bool p_clip) {