summaryrefslogtreecommitdiff
path: root/scene/gui/rich_text_label.cpp
diff options
context:
space:
mode:
authorvolzhs <volzhs@gmail.com>2019-08-05 08:13:47 +0900
committervolzhs <volzhs@gmail.com>2020-04-29 21:56:15 +0900
commit9f1de2cfddf2f5f8f4a9d1f861a3141c052517a2 (patch)
tree59d41eef67b91879017feba086031f05dbb2651a /scene/gui/rich_text_label.cpp
parent1d45a269f87ff38e04169e6aa85d9ecd73fb3473 (diff)
Use underline position and thickness value in font file
Diffstat (limited to 'scene/gui/rich_text_label.cpp')
-rw-r--r--scene/gui/rich_text_label.cpp6
1 files changed, 3 insertions, 3 deletions
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