MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / CursorClamp

Method CursorClamp

imgui_tiny_app/imgui/imgui_widgets.cpp:4313–4313  ·  view source on GitHub ↗

After a user-input the cursor stays on for a while without blinking

Source from the content-addressed store, hash-verified

4311// Those functions are not inlined in imgui_internal.h, allowing us to hide ImStbTexteditState from that header.
4312void ImGuiInputTextState::CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking
4313void ImGuiInputTextState::CursorClamp() { Stb->cursor = ImMin(Stb->cursor, TextLen); Stb->select_start = ImMin(Stb->select_start, TextLen); Stb->select_end = ImMin(Stb->select_end, TextLen); }
4314bool ImGuiInputTextState::HasSelection() const { return Stb->select_start != Stb->select_end; }
4315void ImGuiInputTextState::ClearSelection() { Stb->select_start = Stb->select_end = Stb->cursor; }
4316int ImGuiInputTextState::GetCursorPos() const { return Stb->cursor; }

Callers 1

InputTextExMethod · 0.80

Calls 1

ImMinFunction · 0.85

Tested by

no test coverage detected