Don't use ol.size.equals function

To avoid creating an array on each frame (60 times per second).
This commit is contained in:
Frederic Junod
2013-11-19 17:43:42 +01:00
parent e83c6065ae
commit 7052884913
2 changed files with 2 additions and 4 deletions

View File

@@ -15,7 +15,6 @@ goog.require('ol.renderer.Map');
goog.require('ol.renderer.canvas.ImageLayer');
goog.require('ol.renderer.canvas.TileLayer');
goog.require('ol.renderer.canvas.VectorLayer');
goog.require('ol.size');
goog.require('ol.source.State');
@@ -95,7 +94,7 @@ ol.renderer.canvas.Map.prototype.renderFrame = function(frameState) {
}
var size = frameState.size;
if (!ol.size.equals([this.canvas_.width, this.canvas_.height], size)) {
if (this.canvas_.width != size[0] || this.canvas_.height != size[1]) {
this.canvas_.width = size[0];
this.canvas_.height = size[1];
}