Merge pull request #1822 from tschaub/append-first

Always add first segment when appending coordinates.
This commit is contained in:
Tim Schaub
2014-03-07 11:53:49 -07:00
2 changed files with 88 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
// FIXME add option to apply snapToPixel to all coordinates?
// FIXME can eliminate empty set styles and strokes (when all geoms skipped)
goog.provide('ol.render.canvas.Replay');
goog.provide('ol.render.canvas.ReplayGroup');
goog.require('goog.array');
@@ -166,6 +167,12 @@ ol.render.canvas.Replay.prototype.appendFlatCoordinates =
lastRel = nextRel;
}
// handle case where there is only one point to append
if (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];