Преглед на файлове

Merge pull request #8637 from noshyaar/pr-lineedit

LineEdit: fix placeholder text affected by secret
Rémi Verschelde преди 8 години
родител
ревизия
6034eae95e
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      scene/gui/line_edit.cpp

+ 2 - 2
scene/gui/line_edit.cpp

@@ -633,8 +633,8 @@ void LineEdit::_notification(int p_what) {
 				if (char_ofs >= t.length())
 				if (char_ofs >= t.length())
 					break;
 					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;
 				int char_width = font->get_char_size(cchar, next).width;
 
 
 				// end of widget, break!
 				// end of widget, break!