1
0
mirror of synced 2024-11-12 10:10:53 +01:00

ui: Include null byte in InputText fields

This commit is contained in:
WerWolv 2022-04-14 15:29:54 +02:00
parent 4928c044af
commit 457d338a97

View File

@ -556,11 +556,11 @@ namespace ImGui {
}
bool InputText(const char *label, std::string &buffer, ImGuiInputTextFlags flags) {
return ImGui::InputText(label, buffer.data(), buffer.size(), ImGuiInputTextFlags_CallbackResize | flags, ImGui::UpdateStringSizeCallback, &buffer);
return ImGui::InputText(label, buffer.data(), buffer.size() + 1, ImGuiInputTextFlags_CallbackResize | flags, ImGui::UpdateStringSizeCallback, &buffer);
}
bool InputTextMultiline(const char *label, std::string &buffer, const ImVec2 &size, ImGuiInputTextFlags flags) {
return ImGui::InputTextMultiline(label, buffer.data(), buffer.size(), size, ImGuiInputTextFlags_CallbackResize | flags, ImGui::UpdateStringSizeCallback, &buffer);
return ImGui::InputTextMultiline(label, buffer.data(), buffer.size() + 1, size, ImGuiInputTextFlags_CallbackResize | flags, ImGui::UpdateStringSizeCallback, &buffer);
}
}