summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-18 21:50:14 +0100
committerGitHub <noreply@github.com>2020-03-18 21:50:14 +0100
commitcf50ee4fa4f6a254a4706d4afa0adf10311a5ffb (patch)
treee5665080650a7e833aa0fd6604ce23db3fe20c10 /scene
parentae68c335701fa5f1ecfffd5c39fba21ba66af66d (diff)
parent395a038c85ee0b99045a6edf467f482aa7106c71 (diff)
Merge pull request #37094 from dkaste/line-edit-secret-select
Calculate LineEdit selection with secret character
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/line_edit.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 8fb61cd311..73380c6b1b 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;