diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-06-16 17:54:37 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:17:08 +0300 |
commit | 063a20d481732f704d0f03944f9202b8a304858f (patch) | |
tree | 284d8d2957bd9465b6777bb2c1b12187eb6b9520 /map/user_mark_container.cpp | |
parent | 4cfe3ed54199831f4ab58d891419fdb72e65555f (diff) |
[core] dont show red marker when we have only one search result.
Diffstat (limited to 'map/user_mark_container.cpp')
-rw-r--r-- | map/user_mark_container.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/map/user_mark_container.cpp b/map/user_mark_container.cpp index 577e3181a1..e31f624164 100644 --- a/map/user_mark_container.cpp +++ b/map/user_mark_container.cpp @@ -120,6 +120,7 @@ UserMarkContainer::UserMarkContainer(double layerDepth, Framework & fm) : m_framework(fm) , m_controller(this) , m_isVisible(true) + , m_isDrawable(true) , m_layerDepth(layerDepth) { } @@ -132,19 +133,22 @@ UserMarkContainer::~UserMarkContainer() UserMark const * UserMarkContainer::FindMarkInRect(m2::AnyRectD const & rect, double & d) const { UserMark * mark = NULL; - FindMarkFunctor f(&mark, d, rect); - for_each(m_userMarks.begin(), m_userMarks.end(), f); + if (IsVisible()) + { + FindMarkFunctor f(&mark, d, rect); + for_each(m_userMarks.begin(), m_userMarks.end(), f); + } return mark; } void UserMarkContainer::Draw(PaintOverlayEvent const & e, UserMarkDLCache * cache) const { - if (m_isVisible == false) - return; - - UserMarkDLCache::Key defaultKey(GetTypeName(), graphics::EPosCenter, m_layerDepth); - for_each(m_userMarks.begin(), m_userMarks.end(), bind(&DrawUserMark, 1.0, m_framework.GetVisualScale(), - e, cache, defaultKey, _1)); + if (IsVisible() && IsDrawable()) + { + UserMarkDLCache::Key defaultKey(GetTypeName(), graphics::EPosCenter, m_layerDepth); + for_each(m_userMarks.begin(), m_userMarks.end(), bind(&DrawUserMark, 1.0, m_framework.GetVisualScale(), + e, cache, defaultKey, _1)); + } } void UserMarkContainer::Clear() |