diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index d45abe995ba..7e2d3df7d65 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -452,7 +452,13 @@ void Label::regenerate_word_cache() { } if (i < xl_text.length() && xl_text[i] == ' ') { - if (line_width > 0 || last == nullptr || last->char_pos != WordCache::CHAR_WRAPLINE) { + if (line_width == 0) { + if (current_word_size == 0) { + word_pos = i; + } + current_word_size += space_width; + line_width += space_width; + } else if (line_width > 0 || last == nullptr || last->char_pos != WordCache::CHAR_WRAPLINE) { space_count++; line_width += space_width; } else {