瀏覽代碼

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())
 					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!