diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-03 22:46:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-03 22:46:13 +0200 |
commit | 7c3dc855caf35b56c29e541b83fb4d6b6bd2f28f (patch) | |
tree | b1117e150898ae1887a7a39404b57c65c33ac74f | |
parent | b1b49d966da9d84acc96675ea19adb49f86a5ab8 (diff) | |
parent | b2a32d007d125342efb7a87defcac381afaaa70d (diff) |
Merge pull request #39164 from theoway/richlabeltext_align_bug
Fixes the right and center alignment bug of rich text label
-rw-r--r-- | scene/gui/rich_text_label.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 555ce0af96..2f5af0eda0 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -256,6 +256,11 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int & lh = line < l.height_caches.size() ? l.height_caches[line] : 1; \ line_ascent = line < l.ascent_caches.size() ? l.ascent_caches[line] : 1; \ line_descent = line < l.descent_caches.size() ? l.descent_caches[line] : 1; \ + if (p_mode == PROCESS_DRAW) { \ + if (line < l.offset_caches.size()) { \ + wofs = l.offset_caches[line]; \ + } \ + } \ } \ if (p_mode == PROCESS_POINTER && r_click_item && p_click_pos.y >= p_ofs.y + y && p_click_pos.y <= p_ofs.y + y + lh && p_click_pos.x < p_ofs.x + wofs) { \ if (r_outside) \ |