mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 13:08:47 +02:00
InputText: clarified that callbacks cannot modify buffer when using the ReadOnly flag.
This commit is contained in:
@ -4546,6 +4546,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
if (callback_data.SelectionEnd != utf8_selection_end || buf_dirty) { state->Stb.select_end = (callback_data.SelectionEnd == callback_data.SelectionStart) ? state->Stb.select_start : ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd); }
|
||||
if (buf_dirty)
|
||||
{
|
||||
IM_ASSERT((flags & ImGuiInputTextFlags_ReadOnly) == 0);
|
||||
IM_ASSERT(callback_data.BufTextLen == (int)strlen(callback_data.Buf)); // You need to maintain BufTextLen if you change the text!
|
||||
InputTextReconcileUndoStateAfterUserCallback(state, callback_data.Buf, callback_data.BufTextLen); // FIXME: Move the rest of this block inside function and rename to InputTextReconcileStateAfterUserCallback() ?
|
||||
if (callback_data.BufTextLen > backup_current_text_length && is_resizable)
|
||||
|
Reference in New Issue
Block a user