io.OptNoCursorBlink -> io.OptCursorBlink (#1427)

This commit is contained in:
omar
2017-11-12 16:06:44 +01:00
parent 669498ff26
commit 30bf40195b
2 changed files with 3 additions and 3 deletions

View File

@ -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))