diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-09-19 20:04:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-19 20:04:11 +0200 |
commit | 7adaad1c64604caddc8fcc51fdb2e8045324a854 (patch) | |
tree | 2a59e5789b66b48ff7dbc68bb3910f3f00d871cd /scene | |
parent | b1187b9a2f8e6b6d34a04a4f9e168471de737836 (diff) | |
parent | b0b88df0168f7dcd39bfb22bda7f4ea7a22a5eff (diff) |
Merge pull request #22255 from guilhermefelipecgs/fix_label_min_size
Fix Label::get_minimum_size not updating cache size for autowrap
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/label.cpp | 9 |
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; |