Merge pull request #104356 from Aryombre/104257-fix-selection-lineedit

LineEdit: Fix selection rectangle when text overflows container
This commit is contained in:
Rémi Verschelde 2025-03-21 13:03:57 +01:00
commit 765a750d01
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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);