From 920b32b4327de3d04fb3b102ec408302f9e6ba6d Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 20 Nov 2020 13:51:27 +0100 Subject: [PATCH] Added top offset line to hex editor --- libs/ImGui/include/imgui_memory_editor.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/ImGui/include/imgui_memory_editor.h b/libs/ImGui/include/imgui_memory_editor.h index 24c04d75b..bca0426c8 100644 --- a/libs/ImGui/include/imgui_memory_editor.h +++ b/libs/ImGui/include/imgui_memory_editor.h @@ -231,6 +231,18 @@ struct MemoryEditor footer_height += height_separator + ImGui::GetFrameHeightWithSpacing() * 1; if (OptShowDataPreview) footer_height += height_separator + ImGui::GetFrameHeightWithSpacing() * 1 + ImGui::GetTextLineHeightWithSpacing() * 3; + + ImGui::BeginChild("offset", ImVec2(0, s.LineHeight), false, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav); + ImGui::Text("% *c ", s.AddrDigitsCount, ' '); + for (int i = 0; i < Cols; i++) { + float byte_pos_x = s.PosHexStart + s.HexCellWidth * i; + if (OptMidColsCount > 0) + byte_pos_x += (float)(i / OptMidColsCount) * s.SpacingBetweenMidCols; + ImGui::SameLine(byte_pos_x); + ImGui::Text("%02X", i); + } + ImGui::EndChild(); + ImGui::BeginChild("##scrolling", ImVec2(0, -footer_height), false, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));