Calculate LineEdit selection with secret character
(cherry picked from commit 395a038c85
)
This commit is contained in:
parent
bce2a3a2d2
commit
f657614760
|
@ -1066,8 +1066,12 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
|
|||
|
||||
int char_w = 0;
|
||||
if (font != NULL) {
|
||||
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;
|
||||
|
||||
if (pixel_ofs > p_x) { // Found what we look for.
|
||||
|
|
Loading…
Reference in New Issue