瀏覽代碼

Fixed underlines and striketrough not respecting visible character

janglee 5 年之前
父節點
當前提交
9c2c2ab2b0
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      scene/gui/rich_text_label.cpp

+ 3 - 2
scene/gui/rich_text_label.cpp

@@ -411,7 +411,6 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
 							break; //don't allow lines longer than assigned width
 						}
 
-						w += cw;
 						fw += cw;
 
 						end++;
@@ -552,8 +551,10 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
 									}
 								}
 
-								if (visible)
+								if (visible) {
 									line_is_blank = false;
+									w += font->get_char_size(c[i], c[i + 1]).x;
+								}
 
 								if (c[i] == '\t')
 									visible = false;