瀏覽代碼

Calculate strike-through position correctly

Fixes: #37637
(cherry picked from commit 06a79f260c4c762cce5544471c8b327753ebd153)
Dominik 'dreamsComeTrue' Jasiński 5 年之前
父節點
當前提交
5fdecebee1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/rich_text_label.cpp

+ 1 - 1
scene/gui/rich_text_label.cpp

@@ -602,7 +602,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
 						} else if (strikethrough) {
 							Color uc = color;
 							uc.a *= 0.5;
-							int uy = y + lh / 2 - line_descent + 2;
+							int uy = y + lh - (line_ascent + line_descent) / 2;
 							float strikethrough_width = 1.0;
 #ifdef TOOLS_ENABLED
 							strikethrough_width *= EDSCALE;