summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Felipe <guilhermefelipecgs@gmail.com>2018-09-19 14:05:24 -0300
committerGuilherme Felipe <guilhermefelipecgs@gmail.com>2018-09-19 14:05:44 -0300
commitb0b88df0168f7dcd39bfb22bda7f4ea7a22a5eff (patch)
treedac53e25bbb75ddc46962009a79d589e5a557664
parent6f1513545bc1da4adfa0db476457577131b3e936 (diff)
Fix Label::get_minimum_size not updating cache size for autowrap
-rw-r--r--scene/gui/label.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index ce8de38b74..91dab27930 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -295,14 +295,13 @@ Size2 Label::get_minimum_size() const {
Size2 min_style = get_stylebox("normal")->get_minimum_size();
+ // don't want to mutable everything
+ if (word_cache_dirty)
+ const_cast<Label *>(this)->regenerate_word_cache();
+
if (autowrap)
return Size2(1, clip ? 1 : minsize.height) + min_style;
else {
-
- // don't want to mutable everything
- if (word_cache_dirty)
- const_cast<Label *>(this)->regenerate_word_cache();
-
Size2 ms = minsize;
if (clip)
ms.width = 1;