From d14a2ffb3e62e09e48970f9aab5b70eb53d3ed91 Mon Sep 17 00:00:00 2001 From: rachytski Date: Sun, 14 Oct 2012 15:45:46 +0300 Subject: [PATCH] do not center map when receiving new gps position while dragging. --- map/framework.cpp | 11 ++++++++--- map/framework.hpp | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/map/framework.cpp b/map/framework.cpp index 018b16695b..4e1684b13e 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -925,6 +925,7 @@ void Framework::StartDrag(DragEvent const & e) shared_ptr locationState = m_informationDisplay.locationState(); m_dragCompassProcessMode = locationState->CompassProcessMode(); + m_dragLocationProcessMode = locationState->LocationProcessMode(); } void Framework::DoDrag(DragEvent const & e) @@ -937,8 +938,11 @@ void Framework::DoDrag(DragEvent const & e) m_navigator.DoDrag(pt, ElapsedSeconds()); - m_informationDisplay.locationState()->SetIsCentered(false); - m_informationDisplay.locationState()->StopCompassFollowing(); + shared_ptr locationState = m_informationDisplay.locationState(); + + locationState->SetIsCentered(false); + locationState->StopCompassFollowing(); + locationState->SetLocationProcessMode(location::ELocationDoNothing); if (m_renderPolicy) m_renderPolicy->DoDrag(); @@ -956,7 +960,7 @@ void Framework::StopDrag(DragEvent const & e) shared_ptr locationState = m_informationDisplay.locationState(); - if (locationState->LocationProcessMode() != location::ELocationDoNothing) + if (m_dragLocationProcessMode != location::ELocationDoNothing) { // reset GPS centering mode if we have dragged far from current location ScreenBase const & s = m_navigator.Screen(); @@ -964,6 +968,7 @@ void Framework::StopDrag(DragEvent const & e) locationState->SetLocationProcessMode(location::ELocationDoNothing); else { + locationState->SetLocationProcessMode(m_dragLocationProcessMode); if (m_dragCompassProcessMode == location::ECompassFollow) locationState->AnimateToPositionAndEnqueueFollowing(); else diff --git a/map/framework.hpp b/map/framework.hpp index a3c29b899e..1c9bbfda62 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -108,6 +108,7 @@ protected: int m_height; location::ECompassProcessMode m_dragCompassProcessMode; + location::ELocationProcessMode m_dragLocationProcessMode; //mutable threads::Mutex m_modelSyn;