summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUmang Kalra <umangkalra10@gmail.com>2020-06-03 21:37:34 +0530
committerUmang Kalra <umangkalra10@gmail.com>2020-06-03 21:37:48 +0530
commitb2a32d007d125342efb7a87defcac381afaaa70d (patch)
tree6004fee61a6db5646f7333e3f23726631e5e20d6
parent6aa399be59b886e1c8c371f4ceb09f41c86a0584 (diff)
Fixes the right and center alignment bug of rich text label
-rw-r--r--scene/gui/rich_text_label.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index a57408b83b..cb55ca3b2e 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) \