Only clear canvas when necessary, add tests

This commit is contained in:
Tim Schaub
2017-09-24 10:58:01 -07:00
parent ecc2a9059e
commit 0f53d04361
6 changed files with 85 additions and 5 deletions
+3
View File
@@ -228,6 +228,9 @@ ol.renderer.canvas.TileLayer.prototype.prepareFrame = function(frameState, layer
canvas.width = width;
canvas.height = height;
} else {
if (this.renderedExtent_ && !ol.extent.equals(imageExtent, this.renderedExtent_)) {
context.clearRect(0, 0, width, height);
}
oversampling = this.oversampling_;
}
}