|
@@ -296,8 +296,9 @@ 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)
|
|
|
+ if (word_cache_dirty) {
|
|
|
const_cast<Label *>(this)->regenerate_word_cache();
|
|
|
+ }
|
|
|
|
|
|
if (autowrap)
|
|
|
return Size2(1, clip ? 1 : minsize.height) + min_style;
|
|
@@ -377,8 +378,14 @@ void Label::regenerate_word_cache() {
|
|
|
memdelete(current);
|
|
|
}
|
|
|
|
|
|
- Ref<StyleBox> style = get_stylebox("normal");
|
|
|
- int width = autowrap ? (get_size().width - style->get_minimum_size().width) : get_longest_line_width();
|
|
|
+ int width;
|
|
|
+ if (autowrap) {
|
|
|
+ Ref<StyleBox> style = get_stylebox("normal");
|
|
|
+ width = MAX(get_size().width, get_custom_minimum_size().width) - style->get_minimum_size().width;
|
|
|
+ } else {
|
|
|
+ width = get_longest_line_width();
|
|
|
+ }
|
|
|
+
|
|
|
Ref<Font> font = get_font("font");
|
|
|
|
|
|
int current_word_size = 0;
|