diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-05-30 18:31:46 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:16:16 +0300 |
commit | 16429903fc9ce0fbb5413f39508ae63d9699a962 (patch) | |
tree | 4e496f563efc728ee77d19eb26ef5bf4956462dc /map/bookmark_manager.cpp | |
parent | 9f9d9e1269d63c3b1882b69ad88cd2450d3ae882 (diff) |
[core] move selection drawing into separate container, because when re-search on viewport changed search container cleared, and it's clear selection
Diffstat (limited to 'map/bookmark_manager.cpp')
-rw-r--r-- | map/bookmark_manager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp index fe9f2bc18d..824db49765 100644 --- a/map/bookmark_manager.cpp +++ b/map/bookmark_manager.cpp @@ -23,6 +23,7 @@ BookmarkManager::BookmarkManager(Framework & f) , m_bmScreen(0) , m_lastScale(1.0) , m_cache(NULL) + , m_selection(f) { m_userMarkLayers.reserve(2); m_userMarkLayers.push_back(new SearchUserMarkContainer(graphics::activePinDepth, m_framework)); @@ -276,7 +277,9 @@ void BookmarkManager::DrawItems(shared_ptr<PaintEvent> const & e) const graphics::Screen * pScreen = e->drawer()->screen(); pScreen->beginFrame(); + PaintOverlayEvent event(e->drawer(), screen); + m_selection.Draw(event, m_cache); for_each(m_userMarkLayers.begin(), m_userMarkLayers.end(), bind(&UserMarkContainer::Draw, _1, event, m_cache)); for_each(m_categories.begin(), m_categories.end(), bind(&BookmarkManager::DrawCategory, this, _1, event)); @@ -307,10 +310,7 @@ bool BookmarkManager::DeleteBmCategory(size_t index) void BookmarkManager::ActivateMark(UserMark const * mark) { - for_each(m_categories.begin(), m_categories.end(), bind(&UserMarkContainer::DiactivateMark, _1)); - for_each(m_userMarkLayers.begin(), m_userMarkLayers.end(), bind(&UserMarkContainer::DiactivateMark, _1)); - if (mark != NULL) - mark->Activate(); + m_selection.ActivateMark(mark); } UserMark const * BookmarkManager::FindNearestUserMark(const m2::AnyRectD & rect) |