Skip to content

Commit

Permalink
imgui_memory_editor: fix for ReadOnly mode before we fixed in main li…
Browse files Browse the repository at this point in the history
…b. (#46)
  • Loading branch information
ocornut committed Aug 21, 2024
1 parent ae90ebc commit 49a5ee0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion imgui_memory_editor/imgui_memory_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// - v0.51 (2024/02/22): fix for layout change in 1.89 when using IMGUI_DISABLE_OBSOLETE_FUNCTIONS. (#34)
// - v0.52 (2024/03/08): removed unnecessary GetKeyIndex() calls, they are a no-op since 1.87.
// - v0.53 (2024/05/27): fixed right-click popup from not appearing when using DrawContents(). warning fixes. (#35)
// - v0.54 (2024/07/29): allow ReadOnly mode to still select and preview data. (#46) [@DeltaGW2]
// - v0.54 (2024/07/29): allow ReadOnly mode to still select and preview data. (#46) [@DeltaGW2])
// - v0.55 (2024/08/19): added BgColorFn to allow setting background colors independently from highlighted selection. (#27) [@StrikerX3]
// added MouseHoveredAddr public readable field. (#47, #27) [@StrikerX3]
// fixed a data preview crash with 1.91.0 WIP. fixed contiguous highlight color when using data preview.
Expand Down Expand Up @@ -355,6 +355,10 @@ struct MemoryEditor
InputTextUserData* user_data = (InputTextUserData*)data->UserData;
if (!data->HasSelection())
user_data->CursorPos = data->CursorPos;
#if IMGUI_VERSION_NUM < 19102
if (data->Flags & ImGuiInputTextFlags_ReadOnly)
return 0;
#endif
if (data->SelectionStart == 0 && data->SelectionEnd == data->BufTextLen)
{
// When not editing a byte, always refresh its InputText content pulled from underlying memory data
Expand Down

0 comments on commit 49a5ee0

Please sign in to comment.