mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-23 12:27:01 +00:00
InputText: fixed incorrect edit state after text buffer is modified by user through callback #206
This commit is contained in:
parent
81bf614821
commit
1b5795c96d
@ -6690,7 +6690,8 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
|
|||||||
if (callback_data.SelectionEnd != utf8_selection_end) edit_state.StbState.select_end = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd);
|
if (callback_data.SelectionEnd != utf8_selection_end) edit_state.StbState.select_end = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd);
|
||||||
if (callback_data.BufDirty)
|
if (callback_data.BufDirty)
|
||||||
{
|
{
|
||||||
ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), g.TempBuffer, NULL);
|
edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), g.TempBuffer, NULL);
|
||||||
|
edit_state.CurLenA = strlen(g.TempBuffer);
|
||||||
edit_state.CursorAnimReset();
|
edit_state.CursorAnimReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user