summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-05-04 12:13:42 +0200
committerGitHub <noreply@github.com>2017-05-04 12:13:42 +0200
commit6034eae95ebd0b9c82b4ae33353938dde6732618 (patch)
tree11433067180819bf496e38fd8f32a3ec8ccdafb7
parentf527a6946285502f8d518f054b1bebc1d3fa564e (diff)
parente64c473bc9792a46196be26b30c39a90f92cace6 (diff)
Merge pull request #8637 from noshyaar/pr-lineedit
LineEdit: fix placeholder text affected by secret
-rw-r--r--scene/gui/line_edit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 0acb7265e3..8bb6828fa6 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -633,8 +633,8 @@ void LineEdit::_notification(int p_what) {
if (char_ofs >= t.length())
break;
- CharType cchar = pass ? '*' : t[char_ofs];
- CharType next = pass ? '*' : t[char_ofs + 1];
+ CharType cchar = (pass && !text.empty()) ? '*' : t[char_ofs];
+ CharType next = (pass && !text.empty()) ? '*' : t[char_ofs + 1];
int char_width = font->get_char_size(cchar, next).width;
// end of widget, break!