Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rotate_screen_task.cpp « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3a8cb49ff8350aa3f2015d48fb992379d60e84c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "map/rotate_screen_task.hpp"
#include "map/framework.hpp"

RotateScreenTask::RotateScreenTask(Framework * framework,
                                   double startAngle,
                                   double endAngle,
                                   double speed)
  : anim::AngleInterpolation(startAngle,
                             endAngle,
                             speed,
                             m_outAngle),
    m_framework(framework)
{
}

void RotateScreenTask::OnStep(double ts)
{
  double prevAngle = m_outAngle;
  anim::AngleInterpolation::OnStep(ts);
  Navigator & nav = m_framework->GetNavigator();
  nav.SetAngle(nav.Screen().GetAngle() + m_outAngle - prevAngle);
  m_framework->Invalidate();
}

void RotateScreenTask::OnEnd(double ts)
{
  anim::AngleInterpolation::OnEnd(ts);
  Navigator & nav = m_framework->GetNavigator();
  nav.SetAngle(m_outAngle);
  m_framework->Invalidate();
}

bool RotateScreenTask::IsVisual() const
{
  return true;
}