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

Method EndDrag

libs/drape_frontend/user_event_stream.cpp:1039–1061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1037}
1038
1039bool UserEventStream::EndDrag(Touch const & t, bool cancelled)
1040{
1041 TEST_CALL(END_DRAG);
1042 ASSERT_EQUAL(m_state, STATE_DRAG, ());
1043 m_state = STATE_EMPTY;
1044 if (m_listener)
1045 m_listener->OnDragEnded(m_navigator.GtoP(m_navigator.Screen().GetOrg()) - m_navigator.GtoP(m_startDragOrg));
1046
1047 m_startDragOrg = m2::PointD::Zero();
1048 m_navigator.StopDrag(m2::PointD(t.m_location));
1049
1050 if (!cancelled && m_kineticScrollEnabled && m_scroller.IsActive() &&
1051 m_kineticTimer.ElapsedMilliseconds() >= kKineticDelayMs)
1052 {
1053 drape_ptr<Animation> anim = m_scroller.CreateKineticAnimation(m_navigator.Screen());
1054 if (anim != nullptr)
1055 m_animationSystem.CombineAnimation(std::move(anim));
1056 return false;
1057 }
1058
1059 m_scroller.Cancel();
1060 return true;
1061}
1062
1063void UserEventStream::BeginScale(Touch const & t1, Touch const & t2)
1064{

Callers

nothing calls this directly

Calls 9

ZeroFunction · 0.85
StopDragMethod · 0.80
ElapsedMillisecondsMethod · 0.80
CombineAnimationMethod · 0.80
OnDragEndedMethod · 0.45
GtoPMethod · 0.45
IsActiveMethod · 0.45
CancelMethod · 0.45

Tested by

no test coverage detected