From 2059b93dbcfb5fee386edaa26e392463508e1281 Mon Sep 17 00:00:00 2001 From: zsilencer Date: Mon, 11 Jan 2016 11:20:14 -0700 Subject: [PATCH] Fix #2693: Chat caret --- src/interface/chat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interface/chat.c b/src/interface/chat.c index eb656b22eb..841981d816 100644 --- a/src/interface/chat.c +++ b/src/interface/chat.c @@ -89,13 +89,15 @@ void chat_draw() safe_strncpy(lineCh, _chatCurrentLine, CHAT_INPUT_SIZE); y = _chatBottom - 10; gfx_set_dirty_blocks(x, y, x + gfx_get_string_width(lineBuffer) + 7, y + 12); + gfx_draw_string(dpi, lineBuffer, 255, x, y); if (_chatCaretTicks < 15) { + memcpy(lineBuffer, _chatCurrentLine, gTextInputCursorPosition); + lineBuffer[gTextInputCursorPosition] = 0; int caretX = x + gfx_get_string_width(lineBuffer); int caretY = y + 10; gfx_fill_rect(dpi, caretX, caretY, caretX + 6, caretY + 1, 0x38); } - gfx_draw_string(dpi, lineBuffer, 255, x, y); } }