From 214c00ace97ccc7683e16ffce5ece99c7f772c8e Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 23 Dec 2025 23:29:35 +0100 Subject: [PATCH] fix: Pattern children not getting sorted properly (cherry picked from commit ebc1b531ff5bd7de08cd6df35d2a48d439142509) --- plugins/ui/source/ui/pattern_drawer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/ui/source/ui/pattern_drawer.cpp b/plugins/ui/source/ui/pattern_drawer.cpp index 75b3ab3cf..b9cd36bf1 100644 --- a/plugins/ui/source/ui/pattern_drawer.cpp +++ b/plugins/ui/source/ui/pattern_drawer.cpp @@ -699,7 +699,7 @@ namespace hex::ui { } int id = 1; - pattern.forEachEntry(0, pattern.getEntryCount(), [&] (u64, const auto &field) { + pattern.forEachEntrySorted(0, pattern.getEntryCount(), [&] (u64, const auto &field) { ImGui::PushID(id); this->draw(*field); ImGui::PopID(); @@ -895,7 +895,7 @@ namespace hex::ui { } int id = 1; - pattern.forEachEntry(0, pattern.getEntryCount(), [&](u64, const auto &member){ + pattern.forEachEntrySorted(0, pattern.getEntryCount(), [&](u64, const auto &member){ ImGui::PushID(id); this->draw(*member); ImGui::PopID(); @@ -940,7 +940,7 @@ namespace hex::ui { } int id = 1; - pattern.forEachEntry(0, pattern.getEntryCount(), [&](u64, const auto &member) { + pattern.forEachEntrySorted(0, pattern.getEntryCount(), [&](u64, const auto &member) { ImGui::PushID(id); this->draw(*member); ImGui::PopID(); @@ -1142,7 +1142,7 @@ namespace hex::ui { } int id = 1; - iterable.forEachEntry(i, endIndex, [&](u64, const auto &entry){ + iterable.forEachEntrySorted(i, endIndex, [&](u64, const auto &entry){ ImGui::PushID(id); this->draw(*entry); ImGui::PopID(); @@ -1201,7 +1201,7 @@ namespace hex::ui { ImGui::TableSetupColumn("hex.ui.pattern_drawer.var_name"_lang, ImGuiTableColumnFlags_PreferSortAscending | ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_IndentEnable, 0, ImGui::GetID("name")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.color"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("color")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.start"_lang, ImGuiTableColumnFlags_PreferSortAscending | ImGuiTableColumnFlags_DefaultSort, 0, ImGui::GetID("start")); - ImGui::TableSetupColumn("hex.ui.pattern_drawer.end"_lang, ImGuiTableColumnFlags_PreferSortAscending | ImGuiTableColumnFlags_DefaultSort, 0, ImGui::GetID("end")); + ImGui::TableSetupColumn("hex.ui.pattern_drawer.end"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("end")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.size"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("size")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.type"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("type")); ImGui::TableSetupColumn("hex.ui.pattern_drawer.value"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("value")); @@ -1247,7 +1247,7 @@ namespace hex::ui { if (dynamic_cast(pattern.get()) || dynamic_cast(pattern.get())) return; - iterable->forEachEntry(0, iterable->getEntryCount(), [&](u64, const auto &entry) { + iterable->forEachEntrySorted(0, iterable->getEntryCount(), [&](u64, const auto &entry) { traversePatternTree(entry, patternPath, callback); }); }