Fix slight mistake with cursor position when using delete.

This commit is contained in:
Duncan Frost 2014-10-16 19:29:35 +01:00
parent 9a3aeed508
commit 94c517decb
1 changed files with 1 additions and 1 deletions

View File

@ -430,7 +430,7 @@ void osinterface_process_messages()
gTextInputCursorPosition--;
gTextInputLength--;
}
if (e.key.keysym.sym == SDLK_DELETE && gTextInputLength > 0 && gTextInput && gTextInputCursorPosition != text_input_max_length){
if (e.key.keysym.sym == SDLK_DELETE && gTextInputLength > 0 && gTextInput && gTextInputCursorPosition != gTextInputLength){
memmove(gTextInput + gTextInputCursorPosition, gTextInput + gTextInputCursorPosition + 1, text_input_max_length - gTextInputCursorPosition - 1);
gTextInput[text_input_max_length - 1] = '\0';
gTextInputLength--;