pass: allow removing all pass elements of a given type

This commit is contained in:
Vaxry 2025-01-02 18:14:45 +01:00
parent 81721b8aa8
commit 1697171fc0
2 changed files with 5 additions and 0 deletions

View file

@ -247,3 +247,7 @@ float CRenderPass::oneBlurRadius() {
static auto PBLURPASSES = CConfigValue<Hyprlang::INT>("decoration:blur:passes"); static auto PBLURPASSES = CConfigValue<Hyprlang::INT>("decoration:blur:passes");
return *PBLURPASSES > 10 ? pow(2, 15) : std::clamp(*PBLURSIZE, (int64_t)1, (int64_t)40) * pow(2, *PBLURPASSES); // is this 2^pass? I don't know but it works... I think. return *PBLURPASSES > 10 ? pow(2, 15) : std::clamp(*PBLURSIZE, (int64_t)1, (int64_t)40) * pow(2, *PBLURPASSES); // is this 2^pass? I don't know but it works... I think.
} }
void CRenderPass::removeAllOfType(const std::string& type) {
std::erase_if(m_vPassElements, [&type](const auto& e) { return e->element->passName() == type; });
}

View file

@ -14,6 +14,7 @@ class CRenderPass {
void add(SP<IPassElement> elem); void add(SP<IPassElement> elem);
void clear(); void clear();
void removeAllOfType(const std::string& type);
CRegion render(const CRegion& damage_); CRegion render(const CRegion& damage_);