Only reset canvas transformation matrix when it has changed

This commit is contained in:
Frederic Junod
2013-09-18 19:12:36 +02:00
parent 8a97535d93
commit 9906497cb8

View File

@@ -108,7 +108,6 @@ ol.renderer.canvas.Map.prototype.renderFrame = function(frameState) {
}
var context = this.context_;
context.setTransform(1, 0, 0, 1, 0, 0);
context.clearRect(0, 0, size[0], size[1]);
this.calculateMatrices2D(frameState);
@@ -150,6 +149,7 @@ ol.renderer.canvas.Map.prototype.renderFrame = function(frameState) {
goog.vec.Mat4.getElement(transform, 1, 3));
context.drawImage(image, 0, 0);
context.setTransform(1, 0, 0, 1, 0, 0);
}
}