From 75a62e2bde6496346d3587f25aa69e4bb5b4ca95 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 3 Jul 2024 16:58:56 +0200 Subject: [PATCH] fix: Wrong start/end offset and size for static array entries in pattern data view --- lib/external/pattern_language | 2 +- plugins/ui/source/ui/pattern_drawer.cpp | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/external/pattern_language b/lib/external/pattern_language index b020af259..374229fe5 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit b020af2590b660c6d843a693883867d689065656 +Subproject commit 374229fe5c36fad188b64bd2704ed51d12ded6b5 diff --git a/plugins/ui/source/ui/pattern_drawer.cpp b/plugins/ui/source/ui/pattern_drawer.cpp index eb8925b9a..ebf823125 100644 --- a/plugins/ui/source/ui/pattern_drawer.cpp +++ b/plugins/ui/source/ui/pattern_drawer.cpp @@ -1069,10 +1069,20 @@ namespace hex::ui { ImGui::TableNextColumn(); - drawOffsetColumns(pattern); + if (!pattern.isLocal()) { + ImGui::TableNextColumn(); + ImGuiExt::TextFormatted("0x{0:08X}", startOffset); + ImGui::TableNextColumn(); + ImGuiExt::TextFormatted("0x{0:08X}", endOffset + endSize - (endSize == 0 ? 0 : 1)); + } else { + ImGui::TableNextColumn(); + ImGuiExt::TextFormatted("[{}]", "hex.ui.pattern_drawer.local"_lang); + ImGui::TableNextColumn(); + ImGuiExt::TextFormatted("[{}]", "hex.ui.pattern_drawer.local"_lang); + } ImGui::TableNextColumn(); - ImGuiExt::TextFormatted("0x{0:04X}", chunkSize); + ImGuiExt::TextFormatted("{0} {1}", chunkSize, chunkSize == 1 ? "byte" : "bytes"); ImGui::TableNextColumn(); ImGuiExt::TextFormattedColored(TextEditor::GetPalette()[u32(TextEditor::PaletteIndex::KnownIdentifier)], "{0}", pattern.getTypeName()); ImGui::SameLine(0, 0);