Merge pull request #37123 from simpuid/placeholder-fix

Remove update condition from LineEdit::update_placeholder_width
This commit is contained in:
Rémi Verschelde 2020-03-18 21:49:43 +01:00 committed by GitHub
commit ae68c33570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1710,13 +1710,11 @@ void LineEdit::update_cached_width() {
}
void LineEdit::update_placeholder_width() {
if ((max_length <= 0) || (placeholder_translated.length() <= max_length)) {
Ref<Font> font = get_font("font");
cached_placeholder_width = 0;
if (font != NULL) {
for (int i = 0; i < placeholder_translated.length(); i++) {
cached_placeholder_width += font->get_char_size(placeholder_translated[i]).width;
}
Ref<Font> font = get_font("font");
cached_placeholder_width = 0;
if (font != NULL) {
for (int i = 0; i < placeholder_translated.length(); i++) {
cached_placeholder_width += font->get_char_size(placeholder_translated[i]).width;
}
}
}