From 660acc391335fdf0e74e0935f213554f45c5d2cf Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Sun, 21 Apr 2019 13:55:40 -0300 Subject: [PATCH] Fix 'LineEdit' offset limit not accounting for the right/clear icon width Fully fixes #28242. (cherry picked from commit ac1c52398965fb106075de325f984884932abf9c) --- scene/gui/line_edit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 9d1f749fcca..0414f99ac5f 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -722,6 +722,8 @@ void LineEdit::_notification(int p_what) { } else { x_ofs = MAX(style->get_margin(MARGIN_LEFT), x_ofs - r_icon->get_width() - style->get_margin(MARGIN_RIGHT)); } + + ofs_max -= r_icon->get_width(); } int caret_height = font->get_height() > y_area ? y_area : font->get_height();