Skip to content

Commit

Permalink
InputText: Cursor X position not lost when clicking outside on an ite…
Browse files Browse the repository at this point in the history
…m that's submitted after the InputText(). It was only noticeable when restoring focus programmatically. (#1418, #1554)
  • Loading branch information
ocornut committed Jan 17, 2018
1 parent 28a76af commit 7ccbb76
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8607,8 +8607,11 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
}
else if (io.MouseClicked[0] && !edit_state.SelectedAllMouseLock)
{
stb_textedit_click(&edit_state, &edit_state.StbState, mouse_x, mouse_y);
edit_state.CursorAnimReset();
if (hovered)
{
stb_textedit_click(&edit_state, &edit_state.StbState, mouse_x, mouse_y);
edit_state.CursorAnimReset();
}
}
else if (io.MouseDown[0] && !edit_state.SelectedAllMouseLock && (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f))
{
Expand Down

0 comments on commit 7ccbb76

Please sign in to comment.