Fixes RichTextLabel click issue when cell text wraps

This commit is contained in:
Haoyu Qiu 2020-01-08 08:44:27 +08:00
parent 83fe471c3b
commit d17a4efc43
1 changed files with 19 additions and 18 deletions

View File

@ -264,7 +264,8 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
if (spaces > 0) \ if (spaces > 0) \
spaces -= 1; \ spaces -= 1; \
} \ } \
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) { \ const bool x_in_range = (p_click_pos.x > p_ofs.x + wofs) && (!p_frame->cell || p_click_pos.x < p_ofs.x + p_width); \
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 && x_in_range) { \
if (r_outside) *r_outside = true; \ if (r_outside) *r_outside = true; \
*r_click_item = it; \ *r_click_item = it; \
*r_click_char = rchar; \ *r_click_char = rchar; \