Check for incoming backward delete (unicode 127) and do not insert into text box, just process as a text event

This commit is contained in:
Kalen Hall
2016-08-26 11:08:12 -04:00
parent 7577513efc
commit f614b5dc1a
+4
View File
@@ -10861,6 +10861,10 @@ nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len)
if (!glyph_len) return;
while ((text_len < total_len) && glyph_len)
{
/* don't insert a backward delete, just process the event */
if (unicode == 127)
break;
/* can't add newline in single-line mode */
if (unicode == '\n' && state->single_line)
break;