Skip to content

Commit

Permalink
Fixed 0 width issue of rich text label
Browse files Browse the repository at this point in the history
Fixes godotengine#37746

(cherry picked from commit 5e64c14)
  • Loading branch information
Janglee123 authored and akien-mga committed Mar 2, 2022
1 parent 8bbcc62 commit a1155b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,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
}

Expand Down Expand Up @@ -442,7 +442,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);
Expand Down

0 comments on commit a1155b8

Please sign in to comment.