Call FeatureType::GetLimitRect after all minor checks.

This commit is contained in:
vng 2016-04-12 19:44:53 +03:00
parent ad4d681fa5
commit 23fc0090ee

View file

@ -84,19 +84,14 @@ void RuleDrawer::operator()(FeatureType const & f)
if (CheckCancelled())
return;
int const zoomLevel = m_context->GetTileKey().m_zoomLevel;
m2::RectD const limitRect = f.GetLimitRect(zoomLevel);
if (!m_globalRect.IsIntersect(limitRect))
return;
Stylist s;
m_callback(f, s);
if (s.IsEmpty())
return;
int const zoomLevel = m_context->GetTileKey().m_zoomLevel;
if (s.IsCoastLine() &&
zoomLevel > scales::GetUpperWorldScale() &&
f.GetID().m_mwmId.GetInfo()->GetType() == MwmInfo::COASTS)
@ -115,6 +110,12 @@ void RuleDrawer::operator()(FeatureType const & f)
}
}
// FeatureType::GetLimitRect call invokes full geometry reading and decoding.
// That's why this code follows after all lightweight return options.
m2::RectD const limitRect = f.GetLimitRect(zoomLevel);
if (!m_globalRect.IsIntersect(limitRect))
return;
#ifdef DEBUG
// Validate on feature styles
if (s.AreaStyleExists() == false)