| 934 | } |
| 935 | |
| 936 | bool UserEventStream::TouchUp(std::array<Touch, 2> const & touches) |
| 937 | { |
| 938 | size_t touchCount = GetValidTouchesCount(touches); |
| 939 | bool isMapTouch = true; |
| 940 | switch (m_state) |
| 941 | { |
| 942 | case STATE_EMPTY: |
| 943 | case STATE_WAIT_DOUBLE_TAP: |
| 944 | isMapTouch = false; |
| 945 | // Can be if long tap or double tap detected. |
| 946 | break; |
| 947 | case STATE_FILTER: |
| 948 | ASSERT_EQUAL(touchCount, 1, ()); |
| 949 | EndFilter(touches[0]); |
| 950 | isMapTouch = false; |
| 951 | break; |
| 952 | case STATE_TAP_DETECTION: |
| 953 | if (touchCount == 1) |
| 954 | EndTapDetector(touches[0]); |
| 955 | else |
| 956 | CancelTapDetector(); |
| 957 | break; |
| 958 | case STATE_TAP_TWO_FINGERS: |
| 959 | if (touchCount == 2) |
| 960 | EndTwoFingersTap(); |
| 961 | break; |
| 962 | case STATE_WAIT_DOUBLE_TAP_HOLD: |
| 963 | ASSERT_EQUAL(touchCount, 1, ()); |
| 964 | PerformDoubleTap(touches[0]); |
| 965 | break; |
| 966 | case STATE_DOUBLE_TAP_HOLD: EndDoubleTapAndHold(touches[0]); break; |
| 967 | case STATE_DRAG: |
| 968 | ASSERT_EQUAL(touchCount, 1, ()); |
| 969 | isMapTouch = EndDrag(touches[0], false /* cancelled */); |
| 970 | break; |
| 971 | case STATE_SCALE: |
| 972 | if (touchCount < 2) |
| 973 | { |
| 974 | ASSERT_EQUAL(GetValidTouchesCount(m_touches), 2, ()); |
| 975 | EndScale(m_touches[0], m_touches[1]); |
| 976 | } |
| 977 | else |
| 978 | { |
| 979 | EndScale(touches[0], touches[1]); |
| 980 | } |
| 981 | break; |
| 982 | default: ASSERT(false, ()); break; |
| 983 | } |
| 984 | |
| 985 | UpdateTouches(touches); |
| 986 | return isMapTouch; |
| 987 | } |
| 988 | |
| 989 | void UserEventStream::UpdateTouches(std::array<Touch, 2> const & touches) |
| 990 | { |
nothing calls this directly
no test coverage detected