Skip to content

Commit 897d41c

Browse files
committed
Merge pull request #108597 from bruvzg/rtl_pad_cell
[RTL] Fix text selection offset in padded cells.
2 parents e1e2277 + 2a58331 commit 897d41c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scene/gui/rich_text_label.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ float RichTextLabel::_find_click_in_line(ItemFrame *p_frame, int p_line, const V
16721672
}
16731673
if (crect.has_point(p_click)) {
16741674
for (int j = 0; j < (int)frame->lines.size(); j++) {
1675-
_find_click_in_line(frame, j, rect.position + Vector2(frame->padding.position.x, frame->lines[j].offset.y), rect.size.x, 0, p_click, &table_click_frame, &table_click_line, &table_click_item, &table_click_char, true, p_meta);
1675+
_find_click_in_line(frame, j, rect.position + Vector2(0.0, frame->lines[j].offset.y), rect.size.x, 0, p_click, &table_click_frame, &table_click_line, &table_click_item, &table_click_char, true, p_meta);
16761676
if (table_click_frame && table_click_item) {
16771677
// Save cell detected cell hit data.
16781678
table_range = Vector2i(INT32_MAX, 0);
@@ -1698,7 +1698,7 @@ float RichTextLabel::_find_click_in_line(ItemFrame *p_frame, int p_line, const V
16981698
}
16991699
}
17001700
}
1701-
Rect2 rect = Rect2(p_ofs + off - Vector2(0, TS->shaped_text_get_ascent(rid)) - p_frame->padding.position, TS->shaped_text_get_size(rid) + p_frame->padding.position + p_frame->padding.size);
1701+
Rect2 rect = Rect2(p_ofs + off - Vector2(0, TS->shaped_text_get_ascent(rid)), TS->shaped_text_get_size(rid) + p_frame->padding.size);
17021702
if (p_table) {
17031703
rect.size.y += theme_cache.table_v_separation;
17041704
}

0 commit comments

Comments
 (0)