summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2020-01-10 14:40:05 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2020-01-10 17:08:27 +0800
commitfbd937bd3055bff2722fe79ed501ab421356a926 (patch)
tree8930955e28d25739a2e7d75d28b9885ba267a435 /scene/gui
parent83d950b58e25c401f21b0695a59002fbf6198083 (diff)
Update minimum size on Label::set_autowrap
If `clip_text` is true, the minimum height is one line if `autowrap` is true , or one pixel otherwise.
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/label.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 6b12947651..77913efd1c 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -35,9 +35,17 @@
void Label::set_autowrap(bool p_autowrap) {
+ if (autowrap == p_autowrap) {
+ return;
+ }
+
autowrap = p_autowrap;
word_cache_dirty = true;
update();
+
+ if (clip) {
+ minimum_size_changed();
+ }
}
bool Label::has_autowrap() const {