Bugfix. Drawing turn arrows on the navigation route when they are close to the end and the beginnig of the route.

This commit is contained in:
Vladimir Byko-Ianko 2015-02-04 13:27:48 +03:00 committed by Alex Zolotarev
parent f8222d5ac4
commit c4cdb670d4

View file

@ -42,7 +42,7 @@ bool ClipArrowBodyAndGetArrowDirection(vector<m2::PointD> & ptsTurn, pair<m2::Po
double len = 0, vLen = 0;
while (len < afterTurn)
{
if (i >= ptsTurnSz - 2)
if (i > ptsTurnSz - 2)
return false;
vLen = ptsTurn[i + 1].Length(ptsTurn[i]);
len += vLen;
@ -56,7 +56,7 @@ bool ClipArrowBodyAndGetArrowDirection(vector<m2::PointD> & ptsTurn, pair<m2::Po
size_t j = i;
while (lenForArrow < arrowLength)
{
if (j >= ptsTurnSz - 2)
if (j > ptsTurnSz - 2)
return false;
vLenForArrow = ptsTurn[j + 1].Length(ptsTurn[j]);
lenForArrow += vLenForArrow;
@ -91,7 +91,7 @@ bool ClipArrowBodyAndGetArrowDirection(vector<m2::PointD> & ptsTurn, pair<m2::Po
len = 0;
while (len < beforeTurn)
{
if (i <= 1)
if (i < 1)
return false;
vLen = ptsTurn[i - 1].Length(ptsTurn[i]);
len += vLen;