From d3e7f3c768d75cd31d7b03df4e9f2732e9ddac63 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 22 Jan 2015 09:06:31 +0300 Subject: [PATCH] Fixes after colleagues comments --- map/bookmark_manager.cpp | 4 +++- map/bookmark_manager.hpp | 2 +- map/framework.cpp | 2 +- map/track.cpp | 7 +------ 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp index 9970ef0468..995e699c5c 100644 --- a/map/bookmark_manager.cpp +++ b/map/bookmark_manager.cpp @@ -249,7 +249,7 @@ size_t BookmarkManager::CreateBmCategory(string const & name) return (m_categories.size()-1); } -void BookmarkManager::DrawItems(shared_ptr const & e, int drawScale, double visualScale) const +void BookmarkManager::DrawItems(shared_ptr const & e) const { #ifndef USE_DRAPE ASSERT(m_cache != NULL, ()); @@ -258,6 +258,8 @@ void BookmarkManager::DrawItems(shared_ptr const & e, int drawScale, LazyMatrixCalc matrix(screen, m_lastScale); + double const drawScale = m_framework.GetDrawScale(); + double const visualScale = m_framework.GetVisualScale(); auto trackUpdateFn = [&matrix, &limitRect, this, drawScale, visualScale](Track const * track) { if (limitRect.IsIntersect(track->GetLimitRect())) diff --git a/map/bookmark_manager.hpp b/map/bookmark_manager.hpp index 6b366ff517..72d6e8b86a 100644 --- a/map/bookmark_manager.hpp +++ b/map/bookmark_manager.hpp @@ -55,7 +55,7 @@ public: BookmarkCategory * GetBmCategory(size_t index) const; size_t CreateBmCategory(string const & name); - void DrawItems(shared_ptr const & e, int drawScale, double visualScale) const; + void DrawItems(shared_ptr const & e) const; /// @name Delete bookmarks category with all bookmarks. /// @return true if category was deleted diff --git a/map/framework.cpp b/map/framework.cpp index 88b876a401..c0b0d02309 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -768,7 +768,7 @@ void Framework::DrawAdditionalInfo(shared_ptr const & e) pScreen->endFrame(); - m_bmManager.DrawItems(e, GetDrawScale(), m_guiController->GetVisualScale()); + m_bmManager.DrawItems(e); m_guiController->UpdateElements(); m_guiController->DrawFrame(pScreen); } diff --git a/map/track.cpp b/map/track.cpp index d8e5fa6063..5dbb6e4abb 100644 --- a/map/track.cpp +++ b/map/track.cpp @@ -129,12 +129,7 @@ void drawArrowTriangle(graphics::Screen * dlScreen, pair m2::PointD p1, p2, p3; m2::ArrowPoints(arrowDirection.first, arrowDirection.second, arrowWidth, arrowLength, p1, p2, p3); - vector arrow; - arrow.reserve(3); - arrow.push_back(p1); - arrow.push_back(p2); - arrow.push_back(p3); - + vector arrow = {p1, p2, p3}; dlScreen->drawConvexPolygon(&arrow[0], arrow.size(), arrowColor, arrowDepth); }