| 1037 | } |
| 1038 | |
| 1039 | bool 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 | |
| 1063 | void UserEventStream::BeginScale(Touch const & t1, Touch const & t2) |
| 1064 | { |
nothing calls this directly
no test coverage detected