|
@@ -5618,8 +5618,8 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
|
|
|
// From the moment we focused we are ignoring the content of 'buf'
|
|
// From the moment we focused we are ignoring the content of 'buf'
|
|
|
ImFormatString(edit_state.InitialText, IM_ARRAYSIZE(edit_state.InitialText), "%s", buf);
|
|
ImFormatString(edit_state.InitialText, IM_ARRAYSIZE(edit_state.InitialText), "%s", buf);
|
|
|
const char* buf_end = NULL;
|
|
const char* buf_end = NULL;
|
|
|
- edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end);
|
|
|
|
|
- edit_state.CurLenA = buf_end - buf; // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
|
|
|
|
|
|
|
+ edit_state.CurLenW = (int)ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end);
|
|
|
|
|
+ edit_state.CurLenA = (int)(buf_end - buf); // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
|
|
|
edit_state.Width = w;
|
|
edit_state.Width = w;
|
|
|
edit_state.InputCursorScreenPos = ImVec2(-1.f,-1.f);
|
|
edit_state.InputCursorScreenPos = ImVec2(-1.f,-1.f);
|
|
|
edit_state.CursorAnimReset();
|
|
edit_state.CursorAnimReset();
|