Fix deleting not scrolling (#181)

This commit is contained in:
Pk11 2022-08-02 19:54:52 -05:00 committed by GitHub
parent 249f77b3bc
commit 9b06e85d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,6 +142,12 @@ std::string kbdGetString(std::string label, int maxSize, std::string oldStr) {
stringPosition--;
}
output.erase(output.begin() + stringPosition);
if(cursorPosition - 1 < 0) {
scrollPosition--;
while((output[scrollPosition] & 0xC0) == 0x80) // UTF-8
scrollPosition--;
}
}
} else if(pressed & KEY_START) {
done = true;