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
diff options
context:
space:
mode:
authorrachytski <siarhei.rachytski@gmail.com>2012-09-25 14:57:10 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:43:48 +0300
commit6dd8a1af0b659411bd644dea76231910867f3bc4 (patch)
treec9647792c9b66efadbc9d3ecd4911a0c23aa27e7 /map/compass_arrow.cpp
parentbcce8416b611dc004c85667438caea558b4b362d (diff)
removed duplicate anim::Controller instance.
Diffstat (limited to 'map/compass_arrow.cpp')
-rw-r--r--map/compass_arrow.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/map/compass_arrow.cpp b/map/compass_arrow.cpp
index 3463fd15bc..b580fc6fd4 100644
--- a/map/compass_arrow.cpp
+++ b/map/compass_arrow.cpp
@@ -132,34 +132,16 @@ void CompassArrow::StopAnimation()
bool CompassArrow::onTapEnded(m2::PointD const & pt)
{
- shared_ptr<anim::Controller> animController = m_framework->GetRenderPolicy()->GetAnimController();
+ anim::Controller * animController = m_framework->GetAnimController();
animController->Lock();
/// switching off compass follow mode
m_framework->GetInformationDisplay().locationState()->StopCompassFollowing();
- if (m_rotateScreenTask
- && !m_rotateScreenTask->IsEnded()
- && !m_rotateScreenTask->IsCancelled())
- m_rotateScreenTask->Cancel();
- m_rotateScreenTask.reset();
-
double startAngle = m_framework->GetNavigator().Screen().GetAngle();
double endAngle = 0;
- double period = 2 * math::pi;
-
- startAngle -= floor(startAngle / period) * period;
- endAngle -= floor(endAngle / period) * period;
-
- if (fabs(startAngle - endAngle) > math::pi)
- startAngle -= 2 * math::pi;
-
- m_rotateScreenTask.reset(new RotateScreenTask(m_framework,
- startAngle,
- endAngle,
- 2));
- animController->AddTask(m_rotateScreenTask);
+ m_framework->GetAnimator().RotateScreen(startAngle, endAngle, 2);
animController->Unlock();