diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-03-14 15:31:37 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:12:42 +0300 |
commit | 29e2e6e262c3d030c58aa8dd4cfd6b28f2d8190a (patch) | |
tree | 1d784e72fbc2181e478d80c0169b3526480a3ffc /map/compass_arrow.cpp | |
parent | ca79bc3d4b5439a3c86d1a84f92285191636801d (diff) |
compass hiding fix
Diffstat (limited to 'map/compass_arrow.cpp')
-rw-r--r-- | map/compass_arrow.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/map/compass_arrow.cpp b/map/compass_arrow.cpp index 0c9261b229..cfa3a0a6df 100644 --- a/map/compass_arrow.cpp +++ b/map/compass_arrow.cpp @@ -32,20 +32,20 @@ CompassArrow::CompassArrow(Params const & p) void CompassArrow::AnimateShow() { - if (!isVisible() && (m_animTask == NULL || IsHidingAnim())) + if (!isBaseVisible() && (m_animTask == NULL || IsHidingAnim())) { setIsVisible(true); CreateAnim(0.1, 1.0, 0.2, 0.0, true); } - if (isVisible() && (m_animTask == NULL || IsHidingAnim())) + if (isBaseVisible() && (m_animTask == NULL || IsHidingAnim())) CreateAnim(GetCurrentAlfa(), 1.0, 0.2, 0.0, true); } void CompassArrow::AnimateHide() { - if (isVisible() && (m_animTask == NULL || !IsHidingAnim())) - CreateAnim(1.0, 0.0, 0.3, 1.0, false); + if (isBaseVisible() && (m_animTask == NULL || !IsHidingAnim())) + CreateAnim(1.0, 0.0, 0.3, 0.3, false); } void CompassArrow::SetAngle(double angle) @@ -81,7 +81,7 @@ vector<m2::AnyRectD> const & CompassArrow::boundRects() const void CompassArrow::draw(graphics::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const { - if (isVisible()) + if (isBaseVisible()) { checkDirtyLayout(); @@ -98,6 +98,14 @@ void CompassArrow::draw(graphics::OverlayRenderer * r, } } +bool CompassArrow::isVisible() const +{ + if (m_animTask != NULL && IsHidingAnim()) + return false; + + return isBaseVisible(); +} + void CompassArrow::AlfaAnimEnded(bool isVisible) { setIsVisible(isVisible); @@ -193,6 +201,11 @@ void CompassArrow::purge() m_displayList = NULL; } +bool CompassArrow::isBaseVisible() const +{ + return base_t::isVisible(); +} + bool CompassArrow::onTapEnded(m2::PointD const & pt) { anim::Controller * animController = m_framework->GetAnimController(); |