Do not repeat first vertex when closed is true

This commit is contained in:
Andreas Hocevar
2016-09-12 23:42:54 +02:00
parent 51776ed79e
commit 129757578d
2 changed files with 48 additions and 7 deletions

View File

@@ -157,16 +157,11 @@ ol.render.canvas.Replay.prototype.appendFlatCoordinates = function(flatCoordinat
lastRel = nextRel;
}
// handle case where there is only one point to append
if (i === offset + stride) {
// When we want to close or there is only one point to append:
if ((close && skipped) || i === offset + stride) {
this.coordinates[myEnd++] = lastCoord[0];
this.coordinates[myEnd++] = lastCoord[1];
}
if (close) {
this.coordinates[myEnd++] = flatCoordinates[offset];
this.coordinates[myEnd++] = flatCoordinates[offset + 1];
}
return myEnd;
};