diff options
author | Darren Kaste <darrenkaste@gmail.com> | 2020-03-16 12:22:13 -0400 |
---|---|---|
committer | Darren Kaste <darrenkaste@gmail.com> | 2020-03-16 12:22:13 -0400 |
commit | 395a038c85ee0b99045a6edf467f482aa7106c71 (patch) | |
tree | 51237dc8856a1a99861e782798c7b9d67e4fa7ba /scene | |
parent | 2aa832f415a0132f66d58e54fb1386420cbb0c7f (diff) |
Calculate LineEdit selection with secret character
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/line_edit.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index fdddf0b5fa..41145b1055 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1093,7 +1093,11 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { int char_w = 0; if (font != NULL) { - char_w = font->get_char_size(text[ofs]).width; + if (is_secret()) { + char_w = font->get_char_size(secret_character[0]).width; + } else { + char_w = font->get_char_size(text[ofs]).width; + } } pixel_ofs += char_w; |