From fbd937bd3055bff2722fe79ed501ab421356a926 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 10 Jan 2020 14:40:05 +0800 Subject: [PATCH] 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. --- scene/gui/label.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 6b12947651d..77913efd1c2 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 {