From 9f1de2cfddf2f5f8f4a9d1f861a3141c052517a2 Mon Sep 17 00:00:00 2001 From: volzhs Date: Mon, 5 Aug 2019 08:13:47 +0900 Subject: Use underline position and thickness value in font file --- scene/gui/rich_text_label.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scene/gui/rich_text_label.cpp') diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 9fab9005f9..4ae9d9b2f5 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -600,8 +600,8 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & if (underline) { Color uc = color; uc.a *= 0.5; - int uy = y + lh - line_descent + 2; - float underline_width = 1.0; + int uy = y + lh - line_descent + font->get_underline_position(); + float underline_width = font->get_underline_thickness(); #ifdef TOOLS_ENABLED underline_width *= EDSCALE; #endif @@ -610,7 +610,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & Color uc = color; uc.a *= 0.5; int uy = y + lh - (line_ascent + line_descent) / 2; - float strikethrough_width = 1.0; + float strikethrough_width = font->get_underline_thickness(); #ifdef TOOLS_ENABLED strikethrough_width *= EDSCALE; #endif -- cgit v1.2.3