ImGui::InputText: added support for shift+click style selection. (#5619)

(Amend, force-push: sorry wrong edit by omar)
This commit is contained in:
Constantine Tarasenkov
2022-08-28 20:12:44 +03:00
committed by ocornut
parent fe62927bd8
commit b87e58fab3
3 changed files with 6 additions and 3 deletions

View File

@ -4251,10 +4251,12 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
else if (io.MouseClicked[0] && !state->SelectedAllMouseLock)
{
// FIXME: unselect on late click could be done release?
if (hovered)
{
stb_textedit_click(state, &state->Stb, mouse_x, mouse_y);
if (io.KeyShift)
stb_textedit_drag(state, &state->Stb, mouse_x, mouse_y);
else
stb_textedit_click(state, &state->Stb, mouse_x, mouse_y);
state->CursorAnimReset();
}
}