diff --git a/drape_frontend/apply_feature_functors.cpp b/drape_frontend/apply_feature_functors.cpp index 3a0fd0ca4c..23036021df 100644 --- a/drape_frontend/apply_feature_functors.cpp +++ b/drape_frontend/apply_feature_functors.cpp @@ -900,7 +900,8 @@ ApplyLineFeatureAdditional::ApplyLineFeatureAdditional(TileKey const & tileKey, : TBase(tileKey, insertShape, id, rank, captions) , m_clippedSplines(clippedSplines) , m_currentScaleGtoP(static_cast(currentScaleGtoP)) - , m_depth(0.0f) + , m_captionDepth(0.0f) + , m_shieldDepth(0.0f) , m_captionRule(nullptr) , m_shieldRule(nullptr) {} @@ -910,15 +911,19 @@ void ApplyLineFeatureAdditional::ProcessLineRule(Stylist::TRuleWrapper const & r if (m_clippedSplines.empty()) return; - m_depth = rule.m_depth; - ShieldRuleProto const * pShieldRule = rule.m_rule->GetShield(); if (pShieldRule != nullptr) + { m_shieldRule = pShieldRule; + m_shieldDepth = rule.m_depth; + } CaptionDefProto const * pCaptionRule = rule.m_rule->GetCaption(0); if (pCaptionRule != nullptr && pCaptionRule->height() > 2 && !m_captions.GetMainText().empty()) + { m_captionRule = pCaptionRule; + m_captionDepth = rule.m_depth; + } } void ApplyLineFeatureAdditional::GetRoadShieldsViewParams(ref_ptr texMng, @@ -946,7 +951,7 @@ void ApplyLineFeatureAdditional::GetRoadShieldsViewParams(ref_ptr texMng, PathTextViewParams params; params.m_tileCenter = m_tileRect.Center(); params.m_featureId = m_id; - params.m_depth = m_depth; + params.m_depth = m_captionDepth; params.m_rank = m_rank; params.m_mainText = m_captions.GetMainText(); params.m_auxText = m_captions.GetAuxText(); @@ -1146,7 +1152,6 @@ void ApplyLineFeatureAdditional::Finish(ref_ptr texMng, TextViewParams textParams; ColoredSymbolViewParams symbolParams; PoiSymbolViewParams poiParams; - poiParams.m_featureId = m_id; m2::PointD shieldPixelSize; GetRoadShieldsViewParams(texMng, shield, shieldIndex, static_cast(roadShields.size()), textParams, symbolParams, poiParams, shieldPixelSize); diff --git a/drape_frontend/apply_feature_functors.hpp b/drape_frontend/apply_feature_functors.hpp index aff5d6b05b..b4fb8ee527 100644 --- a/drape_frontend/apply_feature_functors.hpp +++ b/drape_frontend/apply_feature_functors.hpp @@ -206,7 +206,7 @@ private: std::vector m_clippedSplines; float m_currentScaleGtoP; - float m_depth; + float m_captionDepth, m_shieldDepth; CaptionDefProto const * m_captionRule; ShieldRuleProto const * m_shieldRule; }; diff --git a/drape_frontend/text_shape.cpp b/drape_frontend/text_shape.cpp index ec23202c91..120ca8cbb3 100644 --- a/drape_frontend/text_shape.cpp +++ b/drape_frontend/text_shape.cpp @@ -427,6 +427,9 @@ void TextShape::DrawSubStringOutlined(ref_ptr context, batcher->InsertListOfStrip(context, state, make_ref(&provider), std::move(handle), 4); } +// TODO: *Shape classes are concerned with drawing themselves. Its strange they decide/manipulate overlays' priorities +// in the scene. It seems more logical to set priorities beforehand in the creators of *Shapes and pass on final values only. +// Check if such a refactoring makes sense. uint64_t TextShape::GetOverlayPriority() const { // Set up maximum priority for shapes which created by user in the editor and in case of disabling