forked from organicmaps/organicmaps
stopping rotation in CompassArrow when starting a rotation in location::State.
This commit is contained in:
parent
9e16c89bf9
commit
bfc62769b0
3 changed files with 14 additions and 2 deletions
|
@ -121,6 +121,15 @@ void CompassArrow::purge()
|
|||
m_displayList.reset();
|
||||
}
|
||||
|
||||
void CompassArrow::StopAnimation()
|
||||
{
|
||||
if (m_rotateScreenTask
|
||||
&& !m_rotateScreenTask->IsEnded()
|
||||
&& !m_rotateScreenTask->IsCancelled())
|
||||
m_rotateScreenTask->Cancel();
|
||||
m_rotateScreenTask.reset();
|
||||
}
|
||||
|
||||
bool CompassArrow::onTapEnded(m2::PointD const & pt)
|
||||
{
|
||||
shared_ptr<anim::Controller> animController = m_framework->GetRenderPolicy()->GetAnimController();
|
||||
|
@ -149,7 +158,7 @@ bool CompassArrow::onTapEnded(m2::PointD const & pt)
|
|||
m_rotateScreenTask.reset(new RotateScreenTask(m_framework,
|
||||
startAngle,
|
||||
endAngle,
|
||||
1));
|
||||
2));
|
||||
animController->AddTask(m_rotateScreenTask);
|
||||
|
||||
animController->Unlock();
|
||||
|
|
|
@ -66,4 +66,6 @@ public:
|
|||
bool onTapEnded(m2::PointD const & pt);
|
||||
|
||||
bool hitTest(m2::PointD const & pt) const;
|
||||
|
||||
void StopAnimation();
|
||||
};
|
||||
|
|
|
@ -395,6 +395,7 @@ namespace location
|
|||
|
||||
m_framework->GetRenderPolicy()->GetAnimController()->Lock();
|
||||
|
||||
m_framework->GetInformationDisplay().locationState()->StopAnimation();
|
||||
StopAnimation();
|
||||
|
||||
double startAngle = m_framework->GetNavigator().Screen().GetAngle();
|
||||
|
@ -418,7 +419,7 @@ namespace location
|
|||
m_rotateScreenTask.reset(new RotateScreenTask(m_framework,
|
||||
startAngle,
|
||||
endAngle,
|
||||
1));
|
||||
2));
|
||||
|
||||
m_framework->GetRenderPolicy()->GetAnimController()->AddTask(m_rotateScreenTask);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue