Fixes #40207. (cherry picked from commit cec21ab82cff23b2fa97a7c5e25961a38341c8cf)
@@ -188,7 +188,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
if (p_mode != PROCESS_CACHE && align != ALIGN_FILL)
wofs += line_ofs;
- int begin = wofs;
+ int begin = margin;
Ref<Font> cfont = _find_font(it);
if (cfont.is_null())