diff options
author | vng <viktor.govako@gmail.com> | 2013-09-10 16:48:30 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:01:06 +0300 |
commit | 9fe6f4f55fd4b2081d1c3a5cbaf60da512fe221e (patch) | |
tree | e8070914fb6f67b353c4153d638e360732ab66cd /map/address_finder.cpp | |
parent | 2ce27305b7a6fd8c3cee12a42859062a38fc553a (diff) |
Fixed Framework::GetFeatureTypes.
Diffstat (limited to 'map/address_finder.cpp')
-rw-r--r-- | map/address_finder.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/map/address_finder.cpp b/map/address_finder.cpp index e92824122e..adb163a84f 100644 --- a/map/address_finder.cpp +++ b/map/address_finder.cpp @@ -160,22 +160,16 @@ namespace }; } -void Framework::GetFeatureTypes(m2::PointD pt, vector<string> & types) const +void Framework::GetFeatureTypes(m2::PointD const & pxPoint, vector<string> & types) const { - pt = m_navigator.ShiftPoint(pt); + m2::AnyRectD rect; + m_navigator.GetTouchRect(pxPoint, TOUCH_PIXEL_RADIUS * GetVisualScale(), rect); - int const sm = 20; - m2::RectD pixR(m2::PointD(pt.x - sm, pt.y - sm), m2::PointD(pt.x + sm, pt.y + sm)); + // This scale should fit in geometry scales range. + int const scale = min(GetDrawScale(), scales::GetUpperScale()); - m2::RectD glbR; - m_navigator.Screen().PtoG(pixR, glbR); - - int const scale = GetDrawScale(); - DoGetFeatureTypes getTypes(m_navigator.Screen().PtoG(pt), - max(glbR.SizeX(), glbR.SizeY()) / 2.0, - scale); - - m_model.ForEachFeature(glbR, getTypes, scale); + DoGetFeatureTypes getTypes(rect.GlobalCenter(), rect.GetMaxSize() / 2.0, scale); + m_model.ForEachFeature(rect.GetGlobalRect(), getTypes, scale); getTypes.GetFeatureTypes(5, types); } |