Fix off-by-one in imgui call

This commit is contained in:
Patrick Nicolas
2025-09-15 14:36:52 +02:00
parent 88ae120c52
commit 509311604c
+2 -2
View File
@@ -134,14 +134,14 @@ static void InputText(const char * label, std::string & text, const ImVec2 & siz
if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
{
assert(text.data() == data->Buf);
text.resize(data->BufTextLen);
text.resize(data->BufTextLen + 1);
data->Buf = text.data();
}
return 0;
};
ImGui::InputTextEx(label, nullptr, text.data(), text.size(), size, flags | ImGuiInputTextFlags_CallbackResize, callback, &text);
ImGui::InputTextEx(label, nullptr, text.data(), text.size() + 1, size, flags | ImGuiInputTextFlags_CallbackResize, callback, &text);
}
static void display_recentering_tip(imgui_context & ctx, const std::string & tip)