From 15d9bc30df0f44b740c86876354902b21fe5f30d Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Tue, 25 Aug 2015 12:22:25 +0300 Subject: [PATCH] Distance to turn calculation fix. --- routing/route.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routing/route.cpp b/routing/route.cpp index b518a45312..783d4aaa9c 100644 --- a/routing/route.cpp +++ b/routing/route.cpp @@ -153,9 +153,9 @@ void Route::GetCurrentTurn(double & distanceToTurnMeters, turns::TurnItem & turn return lhs.m_index < rhs.m_index; }); - ASSERT_GREATER_OR_EQUAL((*it).m_index - 1, 0, ()); + ASSERT_GREATER_OR_EQUAL((*it).m_index, 0, ()); - size_t const segIdx = (*it).m_index - 1; + size_t const segIdx = (*it).m_index; turn = (*it); distanceToTurnMeters = m_poly.GetDistanceM(m_poly.GetCurrentIter(), m_poly.GetIterToIndex(segIdx));