Browse Source

Draw correct number of UTF-8 codepoints in password TextField.

tags/v2.6.1
Andrew Belt 2 months ago
parent
commit
f2469aa309
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/ui/TextField.cpp

+ 3
- 1
src/ui/TextField.cpp View File

@@ -71,7 +71,9 @@ void TextField::draw(const DrawArgs& args) {


std::string drawText; std::string drawText;
if (password) { if (password) {
drawText = std::string(text.size(), '*');
drawText = std::string(string::UTF8Length(text), '*');
begin = string::UTF8CodepointIndex(text, begin);
end = string::UTF8CodepointIndex(text, end);
} }
else { else {
drawText = text; drawText = text;


Loading…
Cancel
Save