From 30bf40195bc0d3e4668ddb39db25344a622593e4 Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 12 Nov 2017 16:06:44 +0100 Subject: [PATCH] io.OptNoCursorBlink -> io.OptCursorBlink (#1427) --- imgui.cpp | 4 ++-- imgui.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 1f9100c02..5f5a80a79 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -780,7 +780,7 @@ ImGuiIO::ImGuiIO() #else OptMacOSXBehaviors = false; #endif - OptNoCursorBlink = false; + OptCursorBlink = true; // Settings (User Functions) RenderDrawListsFn = NULL; @@ -8494,7 +8494,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2 draw_window->DrawList->AddText(g.Font, g.FontSize, render_pos - render_scroll, GetColorU32(ImGuiCol_Text), buf_display, buf_display + edit_state.CurLenA, 0.0f, is_multiline ? NULL : &clip_rect); // Draw blinking cursor - bool cursor_is_visible = (g.IO.OptNoCursorBlink) || (g.InputTextState.CursorAnim <= 0.0f) || fmodf(g.InputTextState.CursorAnim, 1.20f) <= 0.80f; + bool cursor_is_visible = (!g.IO.OptCursorBlink) || (g.InputTextState.CursorAnim <= 0.0f) || fmodf(g.InputTextState.CursorAnim, 1.20f) <= 0.80f; ImVec2 cursor_screen_pos = render_pos + cursor_offset - render_scroll; ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y-g.FontSize+0.5f, cursor_screen_pos.x+1.0f, cursor_screen_pos.y-1.5f); if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect)) diff --git a/imgui.h b/imgui.h index 68d53dced..162ded07c 100644 --- a/imgui.h +++ b/imgui.h @@ -804,7 +804,7 @@ struct ImGuiIO // Advanced/subtle behaviors bool OptMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl - bool OptNoCursorBlink; // = false // Disable blinking cursor + bool OptCursorBlink; // = true // Enable blinking cursor, for users who consider it annoying. //------------------------------------------------------------------ // Settings (User Functions)