From d068ba8e2b9ce09b4742e04bce764b1ec2bf90e3 Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Wed, 20 Jul 2016 13:30:41 +0300 Subject: [PATCH] Autozoom is enabled by default. Autozoom parameters are tuned. --- drape_frontend/animation/interpolators.cpp | 4 ++-- drape_frontend/my_position_controller.cpp | 6 +++--- map/framework.cpp | 10 ++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drape_frontend/animation/interpolators.cpp b/drape_frontend/animation/interpolators.cpp index b7b6234b4e..aa65ef1589 100644 --- a/drape_frontend/animation/interpolators.cpp +++ b/drape_frontend/animation/interpolators.cpp @@ -196,8 +196,8 @@ ScaleInterpolator::ScaleInterpolator(double delay, double startScale, double end // static double ScaleInterpolator::GetScaleDuration(double startScale, double endScale, bool isAutoZoom) { - // Resize 2.0 times should be done for 1.5 seconds in autozoom or for 0.2 seconds in usual case. - double const kPixelSpeed = isAutoZoom ? (2.0 / 1.5) : (2.0 / 0.2); + // Resize 2.0 times should be done for 1.2 seconds in autozoom or for 0.2 seconds in usual case. + double const kPixelSpeed = isAutoZoom ? (2.0 / 1.2) : (2.0 / 0.2); if (startScale > endScale) swap(startScale, endScale); diff --git a/drape_frontend/my_position_controller.cpp b/drape_frontend/my_position_controller.cpp index 52cb3cbfc8..9b4d42fdfa 100644 --- a/drape_frontend/my_position_controller.cpp +++ b/drape_frontend/my_position_controller.cpp @@ -73,9 +73,9 @@ double CalculateZoomBySpeed(double speed) make_pair(20.0, 0.25), make_pair(40.0, 0.5), make_pair(60.0, 1.0), - make_pair(80.0, 1.75), - make_pair(100.0, 3.5), - make_pair(120.0, 7.0), + make_pair(75.0, 1.75), + make_pair(85.0, 3.5), + make_pair(90.0, 7.0), }; double const kDefaultSpeed = 80.0; diff --git a/map/framework.cpp b/map/framework.cpp index 812761b6c2..5ec8d764b0 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2272,11 +2272,13 @@ void Framework::FollowRoute() return; bool const isPedestrianRoute = m_currentRouterType == RouterType::Pedestrian; + bool const enableAutoZoom = isPedestrianRoute ? false : LoadAutoZoom(); int const scale = isPedestrianRoute ? scales::GetPedestrianNavigationScale() : scales::GetNavigationScale(); - int const scale3d = isPedestrianRoute ? scales::GetPedestrianNavigation3dScale() - : scales::GetNavigation3dScale(); - bool const enableAutoZoom = isPedestrianRoute ? false : LoadAutoZoom(); + int scale3d = isPedestrianRoute ? scales::GetPedestrianNavigation3dScale() + : scales::GetNavigation3dScale(); + if (enableAutoZoom) + ++scale3d; m_drapeEngine->FollowRoute(scale, scale3d, enableAutoZoom); m_drapeEngine->SetRoutePoint(m2::PointD(), true /* isStart */, false /* isValid */); @@ -2541,7 +2543,7 @@ void Framework::Load3dMode(bool & allow3d, bool & allow3dBuildings) bool Framework::LoadAutoZoom() { - bool allowAutoZoom = false; + bool allowAutoZoom = true; settings::Get(kAllowAutoZoom, allowAutoZoom); return allowAutoZoom; }