mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-23 12:27:01 +00:00
InputText: Fixed cursor generating a zero-width wireframe rectangle turning into a division by zero.
This commit is contained in:
parent
da53caf310
commit
e43c5cd3d3
@ -6809,7 +6809,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
|
|||||||
|
|
||||||
// Draw blinking cursor
|
// Draw blinking cursor
|
||||||
if (g.InputTextState.CursorIsVisible())
|
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
|
// Notify OS of text input position for advanced IME
|
||||||
if (io.ImeSetInputScreenPosFn && ImLengthSqr(edit_state.InputCursorScreenPos - cursor_pos) > 0.0001f)
|
if (io.ImeSetInputScreenPosFn && ImLengthSqr(edit_state.InputCursorScreenPos - cursor_pos) > 0.0001f)
|
||||||
|
Loading…
Reference in New Issue
Block a user