summaryrefslogtreecommitdiffstats
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorkit <kitbdev@gmail.com>2024-03-17 18:28:28 -0400
committerkit <kitbdev@gmail.com>2024-03-18 10:13:21 -0400
commit63ac8c1106a295b244fbaffb2837bae363ee90f1 (patch)
tree52fea5c905e245821f02f8d5d6fbe8be42b9c781 /scene/gui/text_edit.cpp
parentfe01776f05b1787b28b4a270d53037a3c25f4ca2 (diff)
downloadredot-engine-63ac8c1106a295b244fbaffb2837bae363ee90f1.tar.gz
Fix TextEdit selection end of line drawing
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 2d7a66d4c0..ccaf7d97d6 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1113,7 +1113,7 @@ void TextEdit::_notification(int p_what) {
Vector<Vector2> sel = TS->shaped_text_get_selection(rid, sel_from, sel_to);
// 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) {
sel.push_back(Vector2(-char_w, 0));
} else {
@@ -1123,7 +1123,7 @@ void TextEdit::_notification(int p_what) {
}
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) {
continue;
}