mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 20:18:47 +02:00
InputText: Clarified comments around ImGuiInputTextFlags_CallbackResize and other callbacks. (#2006, #1443, #1008)
This commit is contained in:
@ -22,6 +22,7 @@ static int InputTextCallback(ImGuiInputTextCallbackData* data)
|
||||
if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
|
||||
{
|
||||
// Resize string callback
|
||||
// If for some reason we refuse the new length (BufTextLen) and/or capacity (BufSize) we need to set them back to what we want.
|
||||
std::string* str = user_data->Str;
|
||||
IM_ASSERT(data->Buf == str->c_str());
|
||||
str->resize(data->BufTextLen);
|
||||
|
Reference in New Issue
Block a user