mirror of
https://github.com/ocornut/imgui.git
synced 2026-09-28 12:23:37 +03:00
InputText: fixed a crash when handling ImGuiInputTextFlags_CallbackResize. (#9174)
Fix/amend cb3b7ff.
This commit is contained in:
parent
27cacb0e30
commit
f4c2f50896
2 changed files with 5 additions and 3 deletions
|
|
@ -87,6 +87,8 @@ Other Changes:
|
|||
signals to be emitted the same way regardless of that setting. (#9001, #9115)
|
||||
- Fixed a glitch when using ImGuiInputTextFlags_ElideLeft where the local x offset
|
||||
would be incorrect during the deactivation frame. (#9298)
|
||||
- Fixed a crash introduced in 1.92.6 when handling ImGuiInputTextFlags_CallbackResize
|
||||
in certain situations. (#9174)
|
||||
- Style:
|
||||
- Border sizes are now scaled (and rounded) by ScaleAllSizes().
|
||||
- When using large values with ScallAllSizes(), the following items thickness
|
||||
|
|
|
|||
|
|
@ -4497,7 +4497,7 @@ static bool InputTextFilterCharacter(ImGuiContext* ctx, ImGuiInputTextState* sta
|
|||
callback_data.Flags = flags;
|
||||
callback_data.EventFlag = ImGuiInputTextFlags_CallbackCharFilter;
|
||||
callback_data.EventChar = (ImWchar)c;
|
||||
callback_data.EventActivated = (g.ActiveId == state->ID && g.ActiveIdIsJustActivated);
|
||||
callback_data.EventActivated = (state && g.ActiveId == state->ID && g.ActiveIdIsJustActivated);
|
||||
callback_data.UserData = user_data;
|
||||
if (callback(&callback_data) != 0)
|
||||
return false;
|
||||
|
|
@ -5286,7 +5286,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
|||
callback_data.ID = id;
|
||||
callback_data.Flags = flags;
|
||||
callback_data.EventFlag = event_flag;
|
||||
callback_data.EventActivated = (g.ActiveId == state->ID && g.ActiveIdIsJustActivated);
|
||||
callback_data.EventActivated = (state && g.ActiveId == state->ID && g.ActiveIdIsJustActivated);
|
||||
callback_data.UserData = callback_user_data;
|
||||
|
||||
// FIXME-OPT: Undo stack reconcile needs a backup of the data until we rework API, see #7925
|
||||
|
|
@ -5368,7 +5368,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
|||
callback_data.ID = id;
|
||||
callback_data.Flags = flags;
|
||||
callback_data.EventFlag = ImGuiInputTextFlags_CallbackResize;
|
||||
callback_data.EventActivated = (g.ActiveId == state->ID && g.ActiveIdIsJustActivated);
|
||||
callback_data.EventActivated = (state != NULL && g.ActiveId == state->ID && g.ActiveIdIsJustActivated);
|
||||
callback_data.Buf = buf;
|
||||
callback_data.BufTextLen = apply_new_text_length;
|
||||
callback_data.BufSize = ImMax(buf_size, apply_new_text_length + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue