forked from organicmaps/organicmaps
fixes according to code review.
This commit is contained in:
parent
2d7685e56b
commit
f9eef1f83b
5 changed files with 9 additions and 11 deletions
|
@ -62,9 +62,9 @@ extern "C"
|
|||
jstring name,
|
||||
jboolean defaultVal)
|
||||
{
|
||||
bool val = static_cast<bool>(defaultVal);
|
||||
bool val = defaultVal;
|
||||
Settings::Get(jni::ToNativeString(env, name), val);
|
||||
return static_cast<jboolean>(val);
|
||||
return val;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
|
@ -73,7 +73,7 @@ extern "C"
|
|||
jstring name,
|
||||
jboolean val)
|
||||
{
|
||||
bool flag = static_cast<bool>(val);
|
||||
bool flag = val;
|
||||
(void)Settings::Set(jni::ToNativeString(env, name), flag);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,7 @@ namespace anim
|
|||
m_endPt(endPt),
|
||||
m_outPt(outPt),
|
||||
m_interval(interval)
|
||||
{
|
||||
m_deltaPt = m_endPt - m_startPt;
|
||||
}
|
||||
{}
|
||||
|
||||
void SegmentInterpolation::OnStart(double ts)
|
||||
{
|
||||
|
@ -33,8 +31,9 @@ namespace anim
|
|||
return;
|
||||
|
||||
double elapsedSec = ts - m_startTime;
|
||||
m2::PointD deltaPt = m_endPt - m_startPt;
|
||||
|
||||
m_outPt = m_startPt + m_deltaPt * (elapsedSec / m_interval);
|
||||
m_outPt = m_startPt + deltaPt * (elapsedSec / m_interval);
|
||||
|
||||
Task::OnStep(ts);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ namespace anim
|
|||
|
||||
m2::PointD m_startPt;
|
||||
m2::PointD m_endPt;
|
||||
m2::PointD m_deltaPt;
|
||||
m2::PointD & m_outPt;
|
||||
double m_startTime;
|
||||
double m_interval;
|
||||
|
|
|
@ -22,7 +22,7 @@ void Animator::RotateScreen(double startAngle, double endAngle, double duration)
|
|||
m_rotateScreenTask->SetEndAngle(endAngle);
|
||||
else
|
||||
{
|
||||
if (floor(ang::RadToDegree(fabs(ang::GetShortestDistance(startAngle, endAngle)))) > 0)
|
||||
if (fabs(ang::GetShortestDistance(startAngle, endAngle)) > math::pi / 180.0)
|
||||
{
|
||||
if (m_rotateScreenTask)
|
||||
{
|
||||
|
|
|
@ -458,8 +458,8 @@ namespace location
|
|||
if (my::rounds(ang::RadToDegree(headingDelta)) > 0)
|
||||
{
|
||||
if (m_headingInterpolation
|
||||
&&!m_headingInterpolation->IsCancelled()
|
||||
&&!m_headingInterpolation->IsEnded())
|
||||
&& !m_headingInterpolation->IsCancelled()
|
||||
&& !m_headingInterpolation->IsEnded())
|
||||
{
|
||||
m_headingInterpolation->Unlock();
|
||||
m_headingInterpolation->Cancel();
|
||||
|
|
Loading…
Add table
Reference in a new issue