Browse Source

Fix 'LineEdit' offset limit not accounting for the right/clear icon width

Fully fixes #28242.

(cherry picked from commit ac1c52398965fb106075de325f984884932abf9c)
Michael Alexsander Silva Dias 6 years ago
parent
commit
660acc3913
1 changed files with 2 additions and 0 deletions
  1. 2 0
      scene/gui/line_edit.cpp

+ 2 - 0
scene/gui/line_edit.cpp

@@ -722,6 +722,8 @@ void LineEdit::_notification(int p_what) {
 				} else {
 				} else {
 					x_ofs = MAX(style->get_margin(MARGIN_LEFT), x_ofs - r_icon->get_width() - style->get_margin(MARGIN_RIGHT));
 					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();
 			int caret_height = font->get_height() > y_area ? y_area : font->get_height();