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:
authorrachytski <siarhei.rachytski@gmail.com>2012-11-14 20:06:08 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:46:55 +0300
commitbce75c20de39ab21ef45fcd631ce07bcdf033647 (patch)
treee9b069c157f56e9c3ff95aa16803d4d012902c23 /map
parent146011c2027e1a99a84af6c48fe382b86b41ae0d (diff)
fixed hitTest handling for location::State and CompassArrow.
Diffstat (limited to 'map')
-rw-r--r--map/compass_arrow.cpp7
-rw-r--r--map/compass_arrow.hpp1
-rw-r--r--map/location_state.cpp5
-rw-r--r--map/location_state.hpp1
4 files changed, 13 insertions, 1 deletions
diff --git a/map/compass_arrow.cpp b/map/compass_arrow.cpp
index 9251e869b9..573b55e64c 100644
--- a/map/compass_arrow.cpp
+++ b/map/compass_arrow.cpp
@@ -162,8 +162,13 @@ unsigned CompassArrow::GetArrowHeight() const
return m_arrowHeight;
}
+bool CompassArrow::roughHitTest(m2::PointD const & pt) const
+{
+ return hitTest(pt);
+}
+
bool CompassArrow::hitTest(m2::PointD const & pt) const
{
- double rad = max(m_arrowWidth / 2, m_arrowHeight / 2);
+ double rad = 1.5 * max(m_arrowWidth / 2, m_arrowHeight / 2);
return pt.Length(pivot()) < rad * visualScale();
}
diff --git a/map/compass_arrow.hpp b/map/compass_arrow.hpp
index e6acb53fe8..efdec9525b 100644
--- a/map/compass_arrow.hpp
+++ b/map/compass_arrow.hpp
@@ -56,5 +56,6 @@ public:
bool onTapEnded(m2::PointD const & pt);
+ bool roughHitTest(m2::PointD const & pt) const;
bool hitTest(m2::PointD const & pt) const;
};
diff --git a/map/location_state.cpp b/map/location_state.cpp
index 7777c10e34..d5102d4572 100644
--- a/map/location_state.cpp
+++ b/map/location_state.cpp
@@ -441,6 +441,11 @@ namespace location
}
}
+ bool State::roughHitTest(m2::PointD const & pt) const
+ {
+ return hitTest(pt);
+ }
+
bool State::hitTest(m2::PointD const & pt) const
{
if (!m_framework->GetNavigator().DoSupportRotation())
diff --git a/map/location_state.hpp b/map/location_state.hpp
index 552bf3890a..538b25218d 100644
--- a/map/location_state.hpp
+++ b/map/location_state.hpp
@@ -178,6 +178,7 @@ namespace location
// @{
vector<m2::AnyRectD> const & boundRects() const;
void draw(graphics::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const;
+ bool roughHitTest(m2::PointD const & pt) const;
bool hitTest(m2::PointD const & pt) const;
bool onTapEnded(m2::PointD const & p);
/// @}