diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-05-30 18:48:25 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:16:16 +0300 |
commit | 9b5edccf4ae3a446935ab1497ef5e78c6013e799 (patch) | |
tree | e42a35138c3bcf8b5231ca83734c908a7f3d1eb7 /map/user_mark_container.cpp | |
parent | 16429903fc9ce0fbb5413f39508ae63d9699a962 (diff) |
review fix
Diffstat (limited to 'map/user_mark_container.cpp')
-rw-r--r-- | map/user_mark_container.cpp | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/map/user_mark_container.cpp b/map/user_mark_container.cpp index 59b80e33da..35b92c7e30 100644 --- a/map/user_mark_container.cpp +++ b/map/user_mark_container.cpp @@ -79,7 +79,7 @@ namespace graphics::DisplayList * dl, m2::PointD const & ptOrg) { - ScreenBase modelView = event.GetModelView(); + ScreenBase const & modelView = event.GetModelView(); graphics::Screen * screen = event.GetDrawer()->screen(); m2::PointD pxPoint = modelView.GtoP(ptOrg); pxPoint += (pixelOfsset * visualScale); @@ -114,16 +114,6 @@ namespace else DrawUserMarkImpl(scale, visualScale, m2::PointD(0.0, 0.0), event, cache->FindUserMark(defaultKey), mark); } - - void DefaultDrawUserMark(double scale, - double visualScale, - PaintOverlayEvent const & event, - UserMarkDLCache * cache, - UserMarkDLCache::Key const & defaultKey, - UserMark const * mark) - { - DrawUserMarkImpl(scale, visualScale, m2::PointD(0.0, 0.0), event, cache->FindUserMark(defaultKey), mark); - } } UserMarkContainer::UserMarkContainer(double layerDepth, Framework & fm) @@ -277,8 +267,7 @@ UserMark * ApiUserMarkContainer::AllocateUserMark(const m2::PointD & ptOrg) SelectionContainer::SelectionContainer(Framework & fm) - : m_hasActiveMark(false) - , m_depth(graphics::minDepth - 100) + : m_container(NULL) , m_fm(fm) { } @@ -288,25 +277,22 @@ void SelectionContainer::ActivateMark(UserMark const * userMark) KillActivationAnim(); if (userMark != NULL) { - m_hasActiveMark = true; m_ptOrg = userMark->GetOrg(); - UserMarkContainer const * container = userMark->GetContainer(); - m_pinImageName = container->GetActiveTypeName(); - m_depth = container->GetDepth(); + m_container = userMark->GetContainer(); StartActivationAnim(); } else - { - m_hasActiveMark = false; - m_depth = graphics::minDepth - 100; - } + m_container = NULL; } void SelectionContainer::Draw(const PaintOverlayEvent & e, UserMarkDLCache * cache) const { - if (m_hasActiveMark) + if (m_container != NULL) { - UserMarkDLCache::Key defaultKey(m_pinImageName, graphics::EPosCenter, m_depth); + UserMarkDLCache::Key defaultKey(m_container->GetActiveTypeName(), + graphics::EPosCenter, + m_container->GetDepth()); + DrawUserMarkByPoint(GetActiveMarkScale(), m_fm.GetVisualScale(), m2::PointD(0, 0), |