diff options
author | volzhs <volzhs@gmail.com> | 2019-08-05 08:13:47 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2020-04-29 21:56:15 +0900 |
commit | 9f1de2cfddf2f5f8f4a9d1f861a3141c052517a2 (patch) | |
tree | 59d41eef67b91879017feba086031f05dbb2651a /scene/gui/text_edit.cpp | |
parent | 1d45a269f87ff38e04169e6aa85d9ecd73fb3473 (diff) | |
download | redot-engine-9f1de2cfddf2f5f8f4a9d1f861a3141c052517a2.tar.gz |
Use underline position and thickness value in font file
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 2d63d86048..5643bb6709 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1487,12 +1487,12 @@ void TextEdit::_notification(int p_what) { int yofs = ofs_y + (get_row_height() - cache.font->get_height()) / 2; int w = drawer.draw_char(ci, Point2i(char_ofs + char_margin + ofs_x, yofs + ascent), str[j], str[j + 1], in_selection && override_selected_font_color ? cache.font_color_selected : color); if (underlined) { - float line_width = 1.0; + float line_width = cache.font->get_underline_thickness(); #ifdef TOOLS_ENABLED line_width *= EDSCALE; #endif - draw_rect(Rect2(char_ofs + char_margin + ofs_x, yofs + ascent + 2, w, line_width), in_selection && override_selected_font_color ? cache.font_color_selected : color); + draw_rect(Rect2(char_ofs + char_margin + ofs_x, yofs + ascent + cache.font->get_underline_position(), w, line_width), in_selection && override_selected_font_color ? cache.font_color_selected : color); } } else if (draw_tabs && str[j] == '\t') { int yofs = (get_row_height() - cache.tab_icon->get_height()) / 2; |