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

Method TouchCancel

libs/drape_frontend/user_event_stream.cpp:899–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

897}
898
899bool 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
936bool UserEventStream::TouchUp(std::array<Touch, 2> const & touches)
937{

Callers

nothing calls this directly

Calls 2

GetValidTouchesCountFunction · 0.85
ASSERTFunction · 0.85

Tested by

no test coverage detected