diff options
author | Gen <z.rz2323721@gmail.com> | 2015-04-29 23:43:39 +0800 |
---|---|---|
committer | Gen <z.rz2323721@gmail.com> | 2015-04-29 23:43:39 +0800 |
commit | 02d672753f18eb3dbae1f5479861b84a1912a5db (patch) | |
tree | be74c5db9fc7f39e34b7a32a3842d43370652ec9 /scene/gui/label.cpp | |
parent | 6fa342a1b05ad4f4f079ba38925e4980439137c4 (diff) |
space is only skipped when autowrap.
Diffstat (limited to 'scene/gui/label.cpp')
-rw-r--r-- | scene/gui/label.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index e5226ca9b3..83b36daff4 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -212,7 +212,7 @@ void Label::_notification(int p_what) { ERR_PRINT("BUG"); return; } - if (from!=wc && from->space_count) { + if (from->space_count) { /* spacing */ x_ofs+=space_w*from->space_count; if (can_fill && align==ALIGN_FILL && spaces) { @@ -411,7 +411,7 @@ void Label::regenerate_word_cache() { if (i<text.length() && text[i] == ' ') { total_char_cache--; // do not count spaces - if (line_width > 0) { + if (line_width > 0 || last==NULL || last->char_pos!=WordCache::CHAR_WRAPLINE) { space_count++; line_width+=space_width; }else { @@ -467,7 +467,6 @@ void Label::regenerate_word_cache() { } - print_line(itos(line_width)); if ((autowrap && line_width>=width && last_width<width) || insert_newline) { WordCache *wc = memnew( WordCache ); |