|
@@ -170,7 +170,7 @@ void Label::_notification(int p_what) {
|
|
|
while(to && to->char_pos>=0) {
|
|
while(to && to->char_pos>=0) {
|
|
|
|
|
|
|
|
taken+=to->pixel_width;
|
|
taken+=to->pixel_width;
|
|
|
- if (to!=from) {
|
|
|
|
|
|
|
+ if (to!=from && to->space_insert) {
|
|
|
spaces++;
|
|
spaces++;
|
|
|
}
|
|
}
|
|
|
to=to->next;
|
|
to=to->next;
|
|
@@ -212,15 +212,15 @@ void Label::_notification(int p_what) {
|
|
|
ERR_PRINT("BUG");
|
|
ERR_PRINT("BUG");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (from!=wc) {
|
|
|
|
|
|
|
+ if (from!=wc && from->space_insert) {
|
|
|
/* spacing */
|
|
/* spacing */
|
|
|
x_ofs+=space_w;
|
|
x_ofs+=space_w;
|
|
|
if (can_fill && align==ALIGN_FILL && spaces) {
|
|
if (can_fill && align==ALIGN_FILL && spaces) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
x_ofs+=int((size.width-(taken+space_w*spaces))/spaces);
|
|
x_ofs+=int((size.width-(taken+space_w*spaces))/spaces);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -411,6 +411,38 @@ void Label::regenerate_word_cache() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ }else if ((current < 65||current >90) && (current<97||current>122)) {
|
|
|
|
|
+ if (current_word_size>0) {
|
|
|
|
|
+
|
|
|
|
|
+ WordCache *wc = memnew( WordCache );
|
|
|
|
|
+ if (word_cache) {
|
|
|
|
|
+ last->next=wc;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ word_cache=wc;
|
|
|
|
|
+ }
|
|
|
|
|
+ last=wc;
|
|
|
|
|
+
|
|
|
|
|
+ wc->pixel_width=current_word_size;
|
|
|
|
|
+ wc->char_pos=word_pos;
|
|
|
|
|
+ wc->word_len=i-word_pos;
|
|
|
|
|
+ current_word_size=0;
|
|
|
|
|
+ }
|
|
|
|
|
+ WordCache *wc = memnew( WordCache );
|
|
|
|
|
+ if (word_cache) {
|
|
|
|
|
+ last->next=wc;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ word_cache=wc;
|
|
|
|
|
+ }
|
|
|
|
|
+ last=wc;
|
|
|
|
|
+
|
|
|
|
|
+ wc->pixel_width=font->get_char_size(current).width;
|
|
|
|
|
+ wc->char_pos=i;
|
|
|
|
|
+ wc->word_len=1;
|
|
|
|
|
+ wc->space_insert = false;
|
|
|
|
|
+ current_word_size=0;
|
|
|
|
|
+ word_pos = i+1;
|
|
|
|
|
+ line_width+=wc->pixel_width;
|
|
|
|
|
+ total_char_cache++;
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
if (current_word_size==0) {
|
|
if (current_word_size==0) {
|