mirror of
https://github.com/godotengine/godot.git
synced 2025-02-11 22:35:15 +08:00
Merge pull request #89625 from kitbdev/not-the-end-of-the-line
Fix TextEdit selection end of line drawing for wrapped lines and gaps
This commit is contained in:
commit
37766c4ef8
@ -1113,7 +1113,7 @@ void TextEdit::_notification(int p_what) {
|
|||||||
Vector<Vector2> sel = TS->shaped_text_get_selection(rid, sel_from, sel_to);
|
Vector<Vector2> sel = TS->shaped_text_get_selection(rid, sel_from, sel_to);
|
||||||
|
|
||||||
// Show selection at the end of line.
|
// Show selection at the end of line.
|
||||||
if (line < get_selection_to_line(c)) {
|
if (line_wrap_index == line_wrap_amount && line < get_selection_to_line(c)) {
|
||||||
if (rtl) {
|
if (rtl) {
|
||||||
sel.push_back(Vector2(-char_w, 0));
|
sel.push_back(Vector2(-char_w, 0));
|
||||||
} else {
|
} else {
|
||||||
@ -1123,7 +1123,7 @@ void TextEdit::_notification(int p_what) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < sel.size(); j++) {
|
for (int j = 0; j < sel.size(); j++) {
|
||||||
Rect2 rect = Rect2(sel[j].x + char_margin + ofs_x, ofs_y, Math::ceil(sel[j].y - sel[j].x), row_height);
|
Rect2 rect = Rect2(sel[j].x + char_margin + ofs_x, ofs_y, Math::ceil(sel[j].y) - sel[j].x, row_height);
|
||||||
if (rect.position.x + rect.size.x <= xmargin_beg || rect.position.x > xmargin_end) {
|
if (rect.position.x + rect.size.x <= xmargin_beg || rect.position.x > xmargin_end) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user