diff --git a/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp b/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp index d46210ab39..f02ed9377c 100644 --- a/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp +++ b/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp @@ -161,7 +161,7 @@ UNIT_TEST(SimpleScale) { size_t const moveEventCount = 5; UserEventStreamTest test(false); - test.SetRect(m2::RectD(-250, -250, 250, 250)); + test.SetRect(m2::RectD(-250.0, -250.0, 250.0, 250.0)); test.AddExpectation(df::UserEventStream::TWO_FINGERS_TAP); test.AddExpectation(df::UserEventStream::BEGIN_SCALE); diff --git a/drape_frontend/message_queue.hpp b/drape_frontend/message_queue.hpp index ef411c118a..88b299963c 100644 --- a/drape_frontend/message_queue.hpp +++ b/drape_frontend/message_queue.hpp @@ -27,7 +27,6 @@ public: bool IsEmpty(); private: - //threads::Condition m_condition; mutex m_mutex; condition_variable m_condition; bool m_isWaiting; diff --git a/drape_frontend/user_event_stream.cpp b/drape_frontend/user_event_stream.cpp index 568d82a154..e9af4a4682 100644 --- a/drape_frontend/user_event_stream.cpp +++ b/drape_frontend/user_event_stream.cpp @@ -457,7 +457,7 @@ bool UserEventStream::TouchDown(array const & touches) bool UserEventStream::TouchMove(array const & touches, double timestamp) { - double const dragThreshold = VisualParams::Instance().GetDragThreshold(); + double const dragThreshold = my::sq(VisualParams::Instance().GetDragThreshold()); size_t touchCount = GetValidTouchesCount(touches); bool isMapTouch = true; @@ -466,7 +466,7 @@ bool UserEventStream::TouchMove(array const & touches, double timestam case STATE_EMPTY: if (touchCount == 1) { - if (m_startDragOrg.Length(touches[0].m_location) > dragThreshold) + if (m_startDragOrg.SquareLength(touches[0].m_location) > dragThreshold) BeginDrag(touches[0], timestamp); else isMapTouch = false; @@ -480,8 +480,8 @@ bool UserEventStream::TouchMove(array const & touches, double timestam if (touchCount == 2) { float const threshold = static_cast(dragThreshold); - if (m_twoFingersTouches[0].Length(touches[0].m_location) > threshold || - m_twoFingersTouches[1].Length(touches[1].m_location) > threshold) + if (m_twoFingersTouches[0].SquareLength(touches[0].m_location) > threshold || + m_twoFingersTouches[1].SquareLength(touches[1].m_location) > threshold) BeginScale(touches[0], touches[1]); else isMapTouch = false; @@ -494,7 +494,7 @@ bool UserEventStream::TouchMove(array const & touches, double timestam case STATE_TAP_DETECTION: case STATE_WAIT_DOUBLE_TAP: ASSERT_EQUAL(touchCount, 1, ()); - if (m_startDragOrg.Length(touches[0].m_location) > dragThreshold) + if (m_startDragOrg.SquareLength(touches[0].m_location) > dragThreshold) CancelTapDetector(); else isMapTouch = false; @@ -572,7 +572,7 @@ bool UserEventStream::TouchUp(array const & touches) EndTapDetector(touches[0]); break; case STATE_TAP_TWO_FINGERS: - if(touchCount == 2) + if (touchCount == 2) { EndTwoFingersTap(); isMapTouch = true;