diff options
author | Constantin Shalnev <c.shalnev@corp.mail.ru> | 2015-10-07 16:39:42 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-11-30 16:16:37 +0300 |
commit | 029197965a48abff0fa21aee2180f091598fba60 (patch) | |
tree | 1d856c03e29c7054917f5e0f2f0a2fe1b45f79d8 /drape_frontend/stylist.cpp | |
parent | 1a2b29e96f02c042db5c149bd9ee884ece5aba74 (diff) |
Added support for dynamic selectors
Diffstat (limited to 'drape_frontend/stylist.cpp')
-rw-r--r-- | drape_frontend/stylist.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drape_frontend/stylist.cpp b/drape_frontend/stylist.cpp index c24110dc83..2a4dcf3d31 100644 --- a/drape_frontend/stylist.cpp +++ b/drape_frontend/stylist.cpp @@ -79,6 +79,16 @@ double CalcPopulationRank(FeatureType const & f) return 0.0; } +void FilterRulesByRuntimeSelector(FeatureType const & f, int zoomLevel, drule::KeysT & keys) +{ + keys.erase_if([&f, zoomLevel](drule::Key const & key)->bool + { + drule::BaseRule const * const rule = drule::rules().Find(key); + ASSERT(rule != nullptr, ()); + return !rule->TestFeature(f, zoomLevel); + }); +} + class KeyFunctor { public: @@ -340,6 +350,8 @@ bool InitStylist(FeatureType const & f, drule::KeysT keys; pair<int, bool> geomType = feature::GetDrawRule(f, zoomLevel, keys); + FilterRulesByRuntimeSelector(f, zoomLevel, keys); + if (keys.empty()) return false; |