Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/map
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-05-22 20:43:30 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:39:04 +0300
commitcc5e4ad665e51f77e5fd8655ce6e70767a6093e9 (patch)
tree4e69891d23a691b85017030d91f492b75256ef97 /map
parentf1c75e7de071eafe1a6470dfecb17c51deb226d7 (diff)
Fix Bookmarks_Getting test.
Diffstat (limited to 'map')
-rw-r--r--map/framework.cpp9
-rw-r--r--map/framework.hpp1
-rw-r--r--map/map_tests/bookmarks_test.cpp2
3 files changed, 9 insertions, 3 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index 7d1f24e1dd..24a6baf677 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -233,9 +233,14 @@ bool Framework::DeleteBmCategory(size_t index)
Bookmark const * Framework::GetBookmark(m2::PointD pt) const
{
if (m_renderPolicy == 0)
- return 0;
+ return 0;
+ return GetBookmark(pt, m_renderPolicy->VisualScale());
+}
+
+Bookmark const * Framework::GetBookmark(m2::PointD pt, double visualScale) const
+{
// Get the global rect of touching area.
- int const sm = 20 * m_renderPolicy->VisualScale();
+ int const sm = 20 * visualScale;
m2::RectD rect(PtoG(m2::PointD(pt.x - sm, pt.y - sm)), PtoG(m2::PointD(pt.x + sm, pt.y + sm)));
Bookmark const * ret = 0;
diff --git a/map/framework.hpp b/map/framework.hpp
index 4100269955..f9e3a533d9 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -144,6 +144,7 @@ public:
/// @param[in] pixPt Coordinates of touch point in pixels.
/// @return NULL If not biikmark near the point.
Bookmark const * GetBookmark(m2::PointD pixPt) const;
+ Bookmark const * GetBookmark(m2::PointD pixPt, double visualScale) const;
void ClearBookmarks();
diff --git a/map/map_tests/bookmarks_test.cpp b/map/map_tests/bookmarks_test.cpp
index ce0e28af72..8fc80073d1 100644
--- a/map/map_tests/bookmarks_test.cpp
+++ b/map/map_tests/bookmarks_test.cpp
@@ -114,7 +114,7 @@ UNIT_TEST(Bookmarks_Getting)
fm.AddBookmark("cat2", Bookmark(m2::PointD(41, 20), "2"));
fm.AddBookmark("cat3", Bookmark(m2::PointD(41, 40), "3"));
- Bookmark const * bm = fm.GetBookmark(pixC);
+ Bookmark const * bm = fm.GetBookmark(pixC, 1.0);
TEST(bm != 0, ());
TEST_EQUAL(bm->GetName(), "2", ());