mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-15 00:44:20 +00:00
This will be part of 1.89.7 Tagged relase.
This commit is contained in:
parent
40aac5875a
commit
d4ddc46e77
3 changed files with 12 additions and 3 deletions
|
|
@ -4052,8 +4052,16 @@ void ImGui::InputTextDeactivateHook(ImGuiID id)
|
|||
if (id == 0 || state->ID != id)
|
||||
return;
|
||||
g.InputTextDeactivatedState.ID = state->ID;
|
||||
g.InputTextDeactivatedState.TextA.resize(state->CurLenA + 1);
|
||||
memcpy(g.InputTextDeactivatedState.TextA.Data, state->TextA.Data ? state->TextA.Data : "", state->CurLenA + 1);
|
||||
if (state->Flags & ImGuiInputTextFlags_ReadOnly)
|
||||
{
|
||||
g.InputTextDeactivatedState.TextA.resize(0); // In theory this data won't be used, but clear to be neat.
|
||||
}
|
||||
else
|
||||
{
|
||||
IM_ASSERT(state->TextA.Data != 0);
|
||||
g.InputTextDeactivatedState.TextA.resize(state->CurLenA + 1);
|
||||
memcpy(g.InputTextDeactivatedState.TextA.Data, state->TextA.Data, state->CurLenA + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Edit a string of text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue