summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-18 21:49:43 +0100
committerGitHub <noreply@github.com>2020-03-18 21:49:43 +0100
commitae68c335701fa5f1ecfffd5c39fba21ba66af66d (patch)
tree72484103b66cc5c1cfcd0cb2d67d008081780af6 /scene
parent87118ac39e43d4e70896476a4d0f69fe4d5f78e5 (diff)
parent43b2f75d6476d56a487d45567fc1e2a9f3eaef32 (diff)
Merge pull request #37123 from simpuid/placeholder-fix
Remove update condition from LineEdit::update_placeholder_width
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/line_edit.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index fdddf0b5fa..8fb61cd311 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -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;
}
}
}