Explorar o código

Fixed 0 width issue of rich text label
Fixes #37746

janglee %!s(int64=5) %!d(string=hai) anos
pai
achega
5e64c146bc
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      scene/gui/rich_text_label.cpp

+ 2 - 2
scene/gui/rich_text_label.cpp

@@ -407,7 +407,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
 							cw = tab_size * font->get_char_size(' ').width;
 						}
 
-						if (end > 0 && w + cw + begin > p_width) {
+						if (end > 0 && fw + cw + begin > p_width) {
 							break; //don't allow lines longer than assigned width
 						}
 
@@ -416,7 +416,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
 						end++;
 					}
 					CHECK_HEIGHT(fh);
-					ENSURE_WIDTH(w);
+					ENSURE_WIDTH(fw);
 
 					line_ascent = MAX(line_ascent, ascent);
 					line_descent = MAX(line_descent, descent);