| 897 | } |
| 898 | |
| 899 | bool UserEventStream::TouchCancel(std::array<Touch, 2> const & touches) |
| 900 | { |
| 901 | size_t touchCount = GetValidTouchesCount(touches); |
| 902 | UNUSED_VALUE(touchCount); |
| 903 | bool isMapTouch = true; |
| 904 | switch (m_state) |
| 905 | { |
| 906 | case STATE_EMPTY: |
| 907 | case STATE_WAIT_DOUBLE_TAP: |
| 908 | case STATE_TAP_TWO_FINGERS: isMapTouch = false; break; |
| 909 | case STATE_WAIT_DOUBLE_TAP_HOLD: |
| 910 | case STATE_DOUBLE_TAP_HOLD: |
| 911 | // Do nothing here. |
| 912 | break; |
| 913 | case STATE_FILTER: |
| 914 | ASSERT_EQUAL(touchCount, 1, ()); |
| 915 | CancelFilter(touches[0]); |
| 916 | break; |
| 917 | case STATE_TAP_DETECTION: |
| 918 | ASSERT_EQUAL(touchCount, 1, ()); |
| 919 | CancelTapDetector(); |
| 920 | isMapTouch = false; |
| 921 | break; |
| 922 | case STATE_DRAG: |
| 923 | ASSERT_EQUAL(touchCount, 1, ()); |
| 924 | isMapTouch = EndDrag(touches[0], true /* cancelled */); |
| 925 | break; |
| 926 | case STATE_SCALE: |
| 927 | ASSERT_EQUAL(touchCount, 2, ()); |
| 928 | EndScale(touches[0], touches[1]); |
| 929 | break; |
| 930 | default: ASSERT(false, ()); break; |
| 931 | } |
| 932 | UpdateTouches(touches); |
| 933 | return isMapTouch; |
| 934 | } |
| 935 | |
| 936 | bool UserEventStream::TouchUp(std::array<Touch, 2> const & touches) |
| 937 | { |
nothing calls this directly
no test coverage detected