Fix keyboard cursor underflow with ascii events --nobuild

This commit is contained in:
Willy-JL
2024-01-24 07:40:45 +00:00
parent 637d915e83
commit 36711fca90

View File

@@ -606,8 +606,10 @@ static bool text_input_view_ascii_callback(AsciiEvent* event, void* context) {
model->cursor_pos =
CLAMP(model->cursor_pos + 1, strlen(model->text_buffer), 0u);
} else {
model->cursor_pos =
CLAMP(model->cursor_pos - 1, strlen(model->text_buffer), 0u);
if(model->cursor_pos > 0) {
model->cursor_pos =
CLAMP(model->cursor_pos - 1, strlen(model->text_buffer), 0u);
}
}
},
true);