Skip to content

Commit d926ccf

Browse files
authored
Merge pull request #109695 from Maran23/3.x-rtl-line-breaking
[3.x] Fix Line breaking may not work correctly when using color tags with specific font
2 parents e4c1dbf + c7bace1 commit d926ccf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scene/gui/rich_text_label.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,6 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
361361
int ascent = font->get_ascent();
362362
int descent = font->get_descent();
363363

364-
// Each BBCode tag is drawn individually, so we have to add the character spacing manually.
365-
int spacing_char = 0;
366-
if (visible_characters != 0) {
367-
spacing_char = font->get_spacing_char();
368-
}
369-
370364
Color color;
371365
Color font_color_shadow;
372366
bool underline = false;
@@ -453,6 +447,12 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
453447

454448
end++;
455449
}
450+
// Each BBCode tag is drawn individually, so we have to add the character spacing manually.
451+
int spacing_char = 0;
452+
if (visible_characters != 0) {
453+
spacing_char = font->get_spacing_char();
454+
}
455+
456456
CHECK_HEIGHT(fh);
457457
ENSURE_WIDTH(w + spacing_char);
458458

0 commit comments

Comments
 (0)