From e3f88395ec85be75b75eb5a93caca0a65125b678 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 12 Oct 2022 14:49:48 +0200 Subject: [PATCH] fix: Hidden attribute not applying to top-level patterns --- plugins/builtin/include/content/helpers/pattern_drawer.hpp | 4 ++-- plugins/builtin/source/content/views/view_pattern_data.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/builtin/include/content/helpers/pattern_drawer.hpp b/plugins/builtin/include/content/helpers/pattern_drawer.hpp index 6272bf089..a3ae5a1a5 100644 --- a/plugins/builtin/include/content/helpers/pattern_drawer.hpp +++ b/plugins/builtin/include/content/helpers/pattern_drawer.hpp @@ -10,6 +10,8 @@ namespace hex { public: PatternDrawer() = default; + void draw(pl::ptrn::Pattern& pattern); + void visit(pl::ptrn::PatternArrayDynamic& pattern) override; void visit(pl::ptrn::PatternArrayStatic& pattern) override; void visit(pl::ptrn::PatternBitfieldField& pattern) override; @@ -29,8 +31,6 @@ namespace hex { void visit(pl::ptrn::PatternWideString& pattern) override; private: - void draw(pl::ptrn::Pattern& pattern); - constexpr static auto ChunkSize = 512; constexpr static auto DisplayEndStep = 64; diff --git a/plugins/builtin/source/content/views/view_pattern_data.cpp b/plugins/builtin/source/content/views/view_pattern_data.cpp index b89580d30..9b041a77e 100644 --- a/plugins/builtin/source/content/views/view_pattern_data.cpp +++ b/plugins/builtin/source/content/views/view_pattern_data.cpp @@ -124,8 +124,9 @@ namespace hex::plugin::builtin { ImGui::TableHeadersRow(); if (!sortedPatterns.empty()) { - for (auto &pattern : sortedPatterns) - pattern->accept(this->m_patternDrawer); + for (auto &pattern : sortedPatterns) { + this->m_patternDrawer.draw(*pattern); + } } ImGui::EndTable();