Skip to content

Commit

Permalink
Merge pull request #71742 from Koyper/rich_text_label_cell_padding_se…
Browse files Browse the repository at this point in the history
…lect_bug

Fixed RichTextLabel wrong selection offset in padded table cell.
  • Loading branch information
YuriSizov authored Apr 11, 2023
2 parents 5e6c382 + 6f11cf7 commit 6a65597
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ float RichTextLabel::_find_click_in_line(ItemFrame *p_frame, int p_line, const V
}
if (crect.has_point(p_click)) {
for (int j = 0; j < (int)frame->lines.size(); j++) {
_find_click_in_line(frame, j, rect.position + Vector2(0, frame->lines[j].offset.y), rect.size.x, p_click, &table_click_frame, &table_click_line, &table_click_item, &table_click_char, true, p_meta);
_find_click_in_line(frame, j, rect.position + Vector2(frame->padding.position.x, frame->lines[j].offset.y), rect.size.x, p_click, &table_click_frame, &table_click_line, &table_click_item, &table_click_char, true, p_meta);
if (table_click_frame && table_click_item) {
// Save cell detected cell hit data.
table_range = Vector2i(INT32_MAX, 0);
Expand Down

0 comments on commit 6a65597

Please sign in to comment.