diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 0d59700223a..ea99da72b0a 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -271,8 +271,8 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & #define ENSURE_WIDTH(m_width) \ if (p_mode == PROCESS_CACHE) { \ - l.maximum_width = MAX(l.maximum_width, MIN(p_width, wofs + m_width)); \ - l.minimum_width = MAX(l.minimum_width, m_width); \ + l.maximum_width = MAX(l.maximum_width, MIN(p_width, Math::ceil(wofs + m_width))); \ + l.minimum_width = MAX(l.minimum_width, Math::ceil(m_width)); \ } \ if (wofs - backtrack + m_width > p_width) { \ line_wrapped = true; \