forked from organicmaps/organicmaps
[routing] Routing following crash fix.
This commit is contained in:
parent
f15e332dec
commit
ae1ff84627
1 changed files with 2 additions and 2 deletions
|
@ -123,11 +123,11 @@ uint32_t Route::GetCurrentTimeToEndSec() const
|
|||
};
|
||||
|
||||
ASSERT_LESS_OR_EQUAL(m_times[idx].first, poly.GetSize(), ());
|
||||
double const dist = distFn(idx > 0 ? m_times[idx - 1].first : 0, m_times[idx].first + 1);
|
||||
double const dist = distFn(idx > 0 ? m_times[idx - 1].first : 0, m_times[idx].first);
|
||||
|
||||
if (!my::AlmostEqualULPs(dist, 0.))
|
||||
{
|
||||
double const distRemain = distFn(m_poly.GetCurrentIter().m_ind, m_times[idx].first + 1) -
|
||||
double const distRemain = distFn(m_poly.GetCurrentIter().m_ind, m_times[idx].first) -
|
||||
MercatorBounds::DistanceOnEarth(m_poly.GetCurrentIter().m_pt, poly.GetPoint(m_poly.GetCurrentIter().m_ind));
|
||||
return (uint32_t)((GetTotalTimeSec() - (*it).second) + (double)time * (distRemain / dist));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue