From f2469aa30943628f0b51ec9de3f942dae2847624 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 10 Feb 2025 01:08:37 -0500 Subject: [PATCH] Draw correct number of UTF-8 codepoints in password TextField. --- src/ui/TextField.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/TextField.cpp b/src/ui/TextField.cpp index 029b9ce9..66e25b64 100644 --- a/src/ui/TextField.cpp +++ b/src/ui/TextField.cpp @@ -71,7 +71,9 @@ void TextField::draw(const DrawArgs& args) { std::string drawText; if (password) { - drawText = std::string(text.size(), '*'); + drawText = std::string(string::UTF8Length(text), '*'); + begin = string::UTF8CodepointIndex(text, begin); + end = string::UTF8CodepointIndex(text, end); } else { drawText = text;