Calculate LineEdit selection with secret character

This commit is contained in:
Darren Kaste 2020-03-16 12:22:13 -04:00
parent 2aa832f415
commit 395a038c85
1 changed files with 5 additions and 1 deletions

View File

@ -1093,7 +1093,11 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
int char_w = 0; int char_w = 0;
if (font != NULL) { 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; pixel_ofs += char_w;