diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2020-01-10 14:40:05 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2020-01-10 17:08:27 +0800 |
commit | fbd937bd3055bff2722fe79ed501ab421356a926 (patch) | |
tree | 8930955e28d25739a2e7d75d28b9885ba267a435 /scene/gui | |
parent | 83d950b58e25c401f21b0695a59002fbf6198083 (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.cpp | 8 |
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 { |