From e43c5cd3d3ccf93ec2341287286fd791e2412bab Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 18 May 2015 23:42:12 +0100 Subject: [PATCH] InputText: Fixed cursor generating a zero-width wireframe rectangle turning into a division by zero. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 351b535c..a876ac32 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6809,7 +6809,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT // Draw blinking cursor if (g.InputTextState.CursorIsVisible()) - window->DrawList->AddRect(cursor_pos - font_off_up + ImVec2(0,2), cursor_pos + font_off_dn - ImVec2(0,3), window->Color(ImGuiCol_Text)); + window->DrawList->AddLine(cursor_pos - font_off_up + ImVec2(0,2), cursor_pos + font_off_dn - ImVec2(0,3), window->Color(ImGuiCol_Text)); // Notify OS of text input position for advanced IME if (io.ImeSetInputScreenPosFn && ImLengthSqr(edit_state.InputCursorScreenPos - cursor_pos) > 0.0001f)