From a0c89858ed773ade98edd96835bfc8b6a0247c35 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 1 Jul 2023 14:06:15 +0200 Subject: [PATCH] patterns: Don't re-evaluate format functions during highlighting --- lib/external/pattern_language | 2 +- .../builtin/source/content/views/view_pattern_editor.cpp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/external/pattern_language b/lib/external/pattern_language index 72ab71a91..85dac5660 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit 72ab71a9166063f4688bc87d55be08ead4f0c1d7 +Subproject commit 85dac566096528099ae956a49a7ccfe7de1d3f97 diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 692ec4cf3..6074c92c1 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -1179,14 +1179,11 @@ namespace hex::plugin::builtin { std::optional color; if (TRY_LOCK(ContentRegistry::PatternLanguage::getRuntimeLock())) { - for (const auto &pattern : runtime.getPatternsAtAddress(address)) { - if (pattern->getVisibility() != pl::ptrn::Visibility::Visible) - continue; - + for (const auto &patternColor : runtime.getColorsAtAddress(address)) { if (color.has_value()) - color = ImAlphaBlendColors(*color, pattern->getColor()); + color = ImAlphaBlendColors(*color, patternColor); else - color = pattern->getColor(); + color = patternColor; } }