From c322eddffb6ac9abc709cfdc7bdc4466bdb7b80a Mon Sep 17 00:00:00 2001 From: Gen Date: Thu, 30 Apr 2015 12:47:05 +0800 Subject: [PATCH] fixed a autowrap bug when word is too length. --- scene/gui/label.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 4069fbb553b..38e7435aeb1 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -99,7 +99,7 @@ void Label::_notification(int p_what) { int chars_total=0; int vbegin=0,vsep=0; - + if (lines_total && lines_total < lines_visible) { @@ -136,10 +136,9 @@ void Label::_notification(int p_what) { if (!wc) return; - + int c = 0; int line=0; while(wc) { - /* handle lines not meant to be drawn quickly */ if (line>line_to) break; @@ -253,7 +252,7 @@ void Label::_notification(int p_what) { } for (int i=0;iword_len;i++) { - + if (visible_chars < 0 || chars_total=width && last_width=width && last && last->char_pos >= 0) || insert_newline) { WordCache *wc = memnew( WordCache ); if (word_cache) { @@ -525,7 +524,7 @@ void Label::regenerate_word_cache() { set_max(line_count); word_cache_dirty=false; - + }