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 1ce0b8e087..590a1318bd 100644 --- a/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp +++ b/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp @@ -38,6 +38,7 @@ public: void OnScaleEnded() override {} void OnAnimationStarted(ref_ptr /* anim */) override {} void OnPerspectiveSwitchRejected() override {} + void OnTouchMapAction() override {} void AddUserEvent(df::TouchEvent const & event) { diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index 2917101a8c..b93ddf24c1 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -719,7 +719,7 @@ void FrontendRenderer::AcceptMessage(ref_ptr message) case Message::Invalidate: { - // Do nothing here, new frame will be rendered because of this message processing. + m_myPositionController->ResetRoutingNotFollowTimer(); break; } @@ -1416,6 +1416,11 @@ void FrontendRenderer::OnPerspectiveSwitchRejected() m_perspectiveDiscarded = false; } +void FrontendRenderer::OnTouchMapAction() +{ + m_myPositionController->ResetRoutingNotFollowTimer(); +} + TTilesCollection FrontendRenderer::ResolveTileKeys(ScreenBase const & screen) { m2::RectD const & rect = screen.ClipRect(); diff --git a/drape_frontend/frontend_renderer.hpp b/drape_frontend/frontend_renderer.hpp index 095d624d3d..d76a94acfc 100755 --- a/drape_frontend/frontend_renderer.hpp +++ b/drape_frontend/frontend_renderer.hpp @@ -195,6 +195,7 @@ private: void OnScaleEnded() override; void OnAnimationStarted(ref_ptr anim) override; void OnPerspectiveSwitchRejected() override; + void OnTouchMapAction() override; class Routine : public threads::IRoutine { diff --git a/drape_frontend/my_position_controller.cpp b/drape_frontend/my_position_controller.cpp index c5b9fb2d55..4129016f01 100644 --- a/drape_frontend/my_position_controller.cpp +++ b/drape_frontend/my_position_controller.cpp @@ -219,6 +219,12 @@ void MyPositionController::Rotated() m_wasRotationInScaling = true; } +void MyPositionController::ResetRoutingNotFollowTimer() +{ + if (m_isInRouting) + m_routingNotFollowTimer.Reset(); +} + void MyPositionController::CorrectScalePoint(m2::PointD & pt) const { if (IsModeChangeViewport()) @@ -680,6 +686,7 @@ void MyPositionController::ActivateRouting(int zoomLevel) if (!m_isInRouting) { m_isInRouting = true; + m_routingNotFollowTimer.Reset(); if (IsRotationAvailable()) { diff --git a/drape_frontend/my_position_controller.hpp b/drape_frontend/my_position_controller.hpp index 46469c6f73..0423c5dfd8 100644 --- a/drape_frontend/my_position_controller.hpp +++ b/drape_frontend/my_position_controller.hpp @@ -66,6 +66,8 @@ public: void Rotated(); + void ResetRoutingNotFollowTimer(); + void CorrectScalePoint(m2::PointD & pt) const; void CorrectScalePoint(m2::PointD & pt1, m2::PointD & pt2) const; void CorrectGlobalScalePoint(m2::PointD & pt) const; diff --git a/drape_frontend/user_event_stream.cpp b/drape_frontend/user_event_stream.cpp index 8f31cafe1e..06ba304c7b 100644 --- a/drape_frontend/user_event_stream.cpp +++ b/drape_frontend/user_event_stream.cpp @@ -725,6 +725,9 @@ bool UserEventStream::ProcessTouch(TouchEvent const & touch) bool UserEventStream::TouchDown(array const & touches) { + if (m_listener) + m_listener->OnTouchMapAction(); + size_t touchCount = GetValidTouchesCount(touches); bool isMapTouch = true; @@ -788,6 +791,9 @@ bool UserEventStream::TouchDown(array const & touches) bool UserEventStream::TouchMove(array const & touches, double timestamp) { + if (m_listener) + m_listener->OnTouchMapAction(); + double const kDragThreshold = my::sq(VisualParams::Instance().GetDragThreshold()); size_t touchCount = GetValidTouchesCount(touches); bool isMapTouch = true; @@ -869,6 +875,9 @@ bool UserEventStream::TouchMove(array const & touches, double timestam bool UserEventStream::TouchCancel(array const & touches) { + if (m_listener) + m_listener->OnTouchMapAction(); + size_t touchCount = GetValidTouchesCount(touches); UNUSED_VALUE(touchCount); bool isMapTouch = true; @@ -910,6 +919,9 @@ bool UserEventStream::TouchCancel(array const & touches) bool UserEventStream::TouchUp(array const & touches) { + if (m_listener) + m_listener->OnTouchMapAction(); + size_t touchCount = GetValidTouchesCount(touches); bool isMapTouch = true; switch (m_state) diff --git a/drape_frontend/user_event_stream.hpp b/drape_frontend/user_event_stream.hpp index 0e90780891..fdbace6b34 100644 --- a/drape_frontend/user_event_stream.hpp +++ b/drape_frontend/user_event_stream.hpp @@ -259,6 +259,8 @@ public: virtual void OnAnimationStarted(ref_ptr anim) = 0; virtual void OnPerspectiveSwitchRejected() = 0; + + virtual void OnTouchMapAction() = 0; }; UserEventStream();