diff --git a/map/routing_manager.cpp b/map/routing_manager.cpp index 8e346d45bc..3bd61cb45f 100644 --- a/map/routing_manager.cpp +++ b/map/routing_manager.cpp @@ -55,7 +55,7 @@ std::string const kRoutePointsFile = "route_points.dat"; uint32_t constexpr kInvalidTransactionId = 0; void FillTurnsDistancesForRendering(std::vector const & segments, - std::vector & turns) + double baseDistance, std::vector & turns) { using namespace routing::turns; turns.clear(); @@ -71,7 +71,7 @@ void FillTurnsDistancesForRendering(std::vector const & segments, { continue; } - turns.push_back(s.GetDistFromBeginningMerc()); + turns.push_back(s.GetDistFromBeginningMerc() - baseDistance); } } @@ -459,7 +459,8 @@ void RoutingManager::InsertRoute(Route const & route) subroute->m_routeType = df::RouteType::Car; subroute->m_color = df::kRouteColor; FillTrafficForRendering(segments, subroute->m_traffic); - FillTurnsDistancesForRendering(segments, subroute->m_turns); + FillTurnsDistancesForRendering(segments, subroute->m_baseDistance, + subroute->m_turns); break; case RouterType::Pedestrian: subroute->m_routeType = df::RouteType::Pedestrian; @@ -470,13 +471,15 @@ void RoutingManager::InsertRoute(Route const & route) subroute->m_routeType = df::RouteType::Bicycle; subroute->m_color = df::kRouteBicycle; subroute->m_pattern = df::RoutePattern(8.0, 2.0); - FillTurnsDistancesForRendering(segments, subroute->m_turns); + FillTurnsDistancesForRendering(segments, subroute->m_baseDistance, + subroute->m_turns); break; case RouterType::Taxi: subroute->m_routeType = df::RouteType::Taxi; subroute->m_color = df::kRouteColor; FillTrafficForRendering(segments, subroute->m_traffic); - FillTurnsDistancesForRendering(segments, subroute->m_turns); + FillTurnsDistancesForRendering(segments, subroute->m_baseDistance, + subroute->m_turns); break; default: ASSERT(false, ("Unknown router type")); }