diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-01-04 13:30:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-04 13:30:00 +0100 |
commit | 94bda27659432852975c5f220b59e755b7413adb (patch) | |
tree | 292d8aae153cb21a1b6836548ed676609890e076 | |
parent | 465d66be6754c446844115d9933022960fe5217c (diff) | |
parent | e74e2763bd6dd52aa29920b7121dd51c9929fc89 (diff) |
Merge pull request #15317 from poke1024/fix-rtl-underline
RichTextLabel: don't draw underline character-wise
-rw-r--r-- | scene/gui/rich_text_label.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 37c7c34432..bf048ea1b6 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -371,19 +371,20 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & cw = tab_size * font->get_char_size(' ').width; } - if (underline) { - Color uc = color; - uc.a *= 0.5; - int uy = y + lh - fh + ascent + 2; - float underline_width = 1.0; -#ifdef TOOLS_ENABLED - underline_width *= EDSCALE; -#endif - VS::get_singleton()->canvas_item_add_line(ci, p_ofs + Point2(align_ofs + pofs, uy), p_ofs + Point2(align_ofs + pofs + cw, uy), uc, underline_width); - } ofs += cw; } } + + if (underline) { + Color uc = color; + uc.a *= 0.5; + int uy = y + lh - fh + ascent + 2; + float underline_width = 1.0; +#ifdef TOOLS_ENABLED + underline_width *= EDSCALE; +#endif + VS::get_singleton()->canvas_item_add_line(ci, p_ofs + Point2(align_ofs + wofs, uy), p_ofs + Point2(align_ofs + wofs + w, uy), uc, underline_width); + } } ADVANCE(fw); |