Update the pointer to the next block when reversing

Just reversing the array is not enough, the pointers to the
beginning of the next block must be changed to the reversed
array index.
This commit is contained in:
ahocevar
2014-03-10 12:37:45 +01:00
parent 30865c2a42
commit c6ba9787b5

View File

@@ -449,6 +449,7 @@ ol.render.canvas.Replay.prototype.reverseHitDetectionInstructions_ =
goog.asserts.assert(begin == -1); goog.asserts.assert(begin == -1);
begin = i; begin = i;
} else if (type == ol.render.canvas.Instruction.BEGIN_GEOMETRY) { } else if (type == ol.render.canvas.Instruction.BEGIN_GEOMETRY) {
instruction[2] = i + 1;
goog.asserts.assert(begin >= 0); goog.asserts.assert(begin >= 0);
ol.array.reverseSubArray(this.hitDetectionInstructions, begin, i); ol.array.reverseSubArray(this.hitDetectionInstructions, begin, i);
begin = -1; begin = -1;