Kaynağa Gözat

Merge pull request #37642 from dreamsComeTrue/rich-text-strike-fix

Calculate strike-through y-position correctly (RichTexteLabel)
Rémi Verschelde 5 yıl önce
ebeveyn
işleme
2c6affe084
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      scene/gui/rich_text_label.cpp

+ 1 - 1
scene/gui/rich_text_label.cpp

@@ -608,7 +608,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;