From 209189b9692b46f356f1d292cc4ea2a23e76f498 Mon Sep 17 00:00:00 2001 From: Aryombre Date: Wed, 19 Mar 2025 10:50:47 +0100 Subject: [PATCH] fix selection in LineEdit --- scene/gui/line_edit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index aa65e939ad9..4eace744e1c 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1202,7 +1202,8 @@ void LineEdit::_notification(int p_what) { if (rect.position.x < x_ofs) { rect.size.x -= (x_ofs - rect.position.x); rect.position.x = x_ofs; - } else if (rect.position.x + rect.size.x > ofs_max) { + } + if (rect.position.x + rect.size.x > ofs_max) { rect.size.x = ofs_max - rect.position.x; } RenderingServer::get_singleton()->canvas_item_add_rect(ci, rect, selection_color);