gpstrek - Fix drawing finish icon
parent
3d7575438e
commit
5433953ca9
|
|
@ -509,6 +509,7 @@ let getMapSlice = function(){
|
||||||
data.poly.push((startingPoint.y-toDraw.y)*-1);
|
data.poly.push((startingPoint.y-toDraw.y)*-1);
|
||||||
if (j < SETTINGS.mapChunkSize - 1) data.i = data.i + (reverse?-1:1);
|
if (j < SETTINGS.mapChunkSize - 1) data.i = data.i + (reverse?-1:1);
|
||||||
}
|
}
|
||||||
|
finish = isLast(route, data.i - 1);
|
||||||
|
|
||||||
data.poly = graphics.transformVertices(data.poly, mapTrans);
|
data.poly = graphics.transformVertices(data.poly, mapTrans);
|
||||||
graphics.drawPoly(data.poly, false);
|
graphics.drawPoly(data.poly, false);
|
||||||
|
|
@ -526,12 +527,9 @@ let getMapSlice = function(){
|
||||||
graphics.drawString(c.n, data.poly[c.i] + 10, data.poly[c.i+1]);
|
graphics.drawString(c.n, data.poly[c.i] + 10, data.poly[c.i+1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
finish = isLast(route, currentRouteIndex + data.i);
|
|
||||||
|
|
||||||
if (finish)
|
if (finish)
|
||||||
graphics.drawImage(finishIcon, data.poly[data.poly.length - 2] -5, data.poly[data.poly.length - 1] - 4);
|
graphics.drawImage(finishIcon, data.poly[data.poly.length - 2] -5, data.poly[data.poly.length - 1] - 4);
|
||||||
|
else if (last) {
|
||||||
if (last) {
|
|
||||||
graphics.drawImage(cross, data.poly[data.poly.length - 2] - cross.width/2, data.poly[data.poly.length - 1] - cross.height/2);
|
graphics.drawImage(cross, data.poly[data.poly.length - 2] - cross.width/2, data.poly[data.poly.length - 1] - cross.height/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1055,12 +1053,12 @@ let prev = function(route){
|
||||||
};
|
};
|
||||||
|
|
||||||
let getLast = function(route){
|
let getLast = function(route){
|
||||||
lastMirror = route.mirror;
|
|
||||||
return get(route, route.indexToOffset.length - 1);
|
return get(route, route.indexToOffset.length - 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
let isLast = function(route, index){
|
let isLast = function(route, index){
|
||||||
if (isNaN(index)) index = route.index;
|
if (isNaN(index)) index = route.index;
|
||||||
|
index = getWaypointIndex(route, index);
|
||||||
return route.indexToOffset.length - 1 == index;
|
return route.indexToOffset.length - 1 == index;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue