MCPcopy Create free account
hub / github.com/comaps/comaps / SetScreen

Method SetScreen

libs/drape_frontend/user_event_stream.cpp:546–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546bool UserEventStream::SetScreen(ScreenBase const & endScreen, bool isAnim,
547 TAnimationCreator const & parallelAnimCreator)
548{
549 if (isAnim)
550 {
551 ScreenBase const & screen = GetCurrentScreen();
552
553 drape_ptr<Animation> anim = GetRectAnimation(screen, endScreen);
554 if (!df::IsAnimationAllowed(anim->GetDuration(), screen))
555 {
556 anim.reset();
557 double const moveDuration = PositionInterpolator::GetMoveDuration(screen.GetOrg(), endScreen.GetOrg(), screen);
558 if (moveDuration > kMaxAnimationTimeSec)
559 anim = GetPrettyMoveAnimation(screen, endScreen);
560 }
561 else
562 {
563 anim->SetMaxDuration(kMaxAnimationTimeSec);
564 }
565
566 if (anim != nullptr)
567 {
568 if (parallelAnimCreator != nullptr)
569 {
570 drape_ptr<ParallelAnimation> parallelAnim = make_unique_dp<ParallelAnimation>();
571 parallelAnim->SetCustomType(kParallelLinearAnim);
572 parallelAnim->AddAnimation(parallelAnimCreator(nullptr /* syncAnim */));
573 parallelAnim->AddAnimation(std::move(anim));
574 m_animationSystem.CombineAnimation(std::move(parallelAnim));
575 }
576 else
577 {
578 m_animationSystem.CombineAnimation(std::move(anim));
579 }
580 return false;
581 }
582 }
583
584 ResetMapPlaneAnimations();
585 m_navigator.SetFromScreen(endScreen);
586 return true;
587}
588
589bool UserEventStream::InterruptFollowAnimations(bool force)
590{

Callers

nothing calls this directly

Calls 10

GetRectAnimationFunction · 0.85
IsAnimationAllowedFunction · 0.85
GetPrettyMoveAnimationFunction · 0.85
CombineAnimationMethod · 0.80
SetFromScreenMethod · 0.80
GetDurationMethod · 0.45
resetMethod · 0.45
SetMaxDurationMethod · 0.45
SetCustomTypeMethod · 0.45
AddAnimationMethod · 0.45

Tested by

no test coverage detected