diff --git a/map/animator.cpp b/map/animator.cpp index 0eb8913eac..2568fe0b8c 100644 --- a/map/animator.cpp +++ b/map/animator.cpp @@ -11,7 +11,7 @@ Animator::Animator(Framework * framework) : m_framework(framework) {} -void Animator::RotateScreen(double startAngle, double endAngle, double duration) +void Animator::RotateScreen(double startAngle, double endAngle) { if (m_rotateScreenTask) m_rotateScreenTask->Lock(); @@ -35,7 +35,7 @@ void Animator::RotateScreen(double startAngle, double endAngle, double duration) m_rotateScreenTask.reset(new RotateScreenTask(m_framework, startAngle, endAngle, - duration)); + GetRotationSpeed())); m_framework->GetAnimController()->AddTask(m_rotateScreenTask); return; @@ -103,3 +103,9 @@ void Animator::StopChangeViewport() m_changeViewportTask.reset(); } + +double Animator::GetRotationSpeed() const +{ + /// making full circle in 3 seconds. + return 3; +} diff --git a/map/animator.hpp b/map/animator.hpp index cdc6898ee3..6f308af36b 100644 --- a/map/animator.hpp +++ b/map/animator.hpp @@ -25,8 +25,7 @@ public: Animator(Framework * framework); /// rotate screen by shortest path. void RotateScreen(double startAngle, - double endAngle, - double duration); + double endAngle); /// stopping screen rotation void StopRotation(); /// move screen from one point to another @@ -35,4 +34,6 @@ public: double rotationSpeed); /// stop screen moving void StopChangeViewport(); + /// get screen rotation speed + double GetRotationSpeed() const; }; diff --git a/map/compass_arrow.cpp b/map/compass_arrow.cpp index c1bb3672a1..b2f457947a 100644 --- a/map/compass_arrow.cpp +++ b/map/compass_arrow.cpp @@ -134,7 +134,7 @@ bool CompassArrow::onTapEnded(m2::PointD const & pt) double startAngle = m_framework->GetNavigator().Screen().GetAngle(); double endAngle = 0; - m_framework->GetAnimator().RotateScreen(startAngle, endAngle, 2); + m_framework->GetAnimator().RotateScreen(startAngle, endAngle); animController->Unlock(); diff --git a/map/location_state.cpp b/map/location_state.cpp index 29b10e7d4c..a58d15ddf8 100644 --- a/map/location_state.cpp +++ b/map/location_state.cpp @@ -479,7 +479,7 @@ namespace location m_headingInterpolation.reset(new anim::AngleInterpolation(m_drawHeading, m_compassFilter.GetHeadingRad(), - 1, + m_framework->GetAnimator().GetRotationSpeed(), m_drawHeading)); m_framework->GetAnimController()->AddTask(m_headingInterpolation); @@ -516,7 +516,7 @@ namespace location double startAngle = m_framework->GetNavigator().Screen().GetAngle(); double endAngle = -m_compassFilter.GetHeadingRad(); - m_framework->GetAnimator().RotateScreen(startAngle, endAngle, 2); + m_framework->GetAnimator().RotateScreen(startAngle, endAngle); controller->Unlock(); }