Skip to content

Commit

Permalink
imgui: cleanup text input for color text editor find/replace
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Sep 25, 2024
1 parent 6e1e41f commit 3aa8657
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Quake/ImGuiColorTextEdit/TextEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3376,13 +3376,13 @@ bool TextEditor::InputStdString(const char* label, std::string* value, ImGuiInpu
{
flags |= ImGuiInputTextFlags_NoUndoRedo | ImGuiInputTextFlags_CallbackResize;

return ImGui::InputText(label, &(*value)[0], value->capacity() + 1, flags, [](ImGuiInputTextCallbackData* data)
return ImGui::InputText(label, value->data(), value->capacity() + 1, flags, [](ImGuiInputTextCallbackData* data)
{
if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
{
std::string* value = (std::string*) data->UserData;
std::string* value = static_cast<std::string*>(data->UserData);
value->resize(data->BufTextLen);
data->Buf = &(*value)[0];
data->Buf = value->data();
}

return 0;
Expand Down

0 comments on commit 3aa8657

Please sign in to comment.