Redefine ol.Size to be Array.<number>

This commit is contained in:
Frederic Junod
2013-05-31 16:24:47 +02:00
parent 1d7ca27e61
commit a1a7e21f92
33 changed files with 139 additions and 157 deletions

View File

@@ -1,25 +1,20 @@
goog.provide('ol.Size');
goog.require('goog.math.Size');
goog.provide('ol.size');
/**
* @constructor
* @extends {goog.math.Size}
* @param {number} width Width.
* @param {number} height Height.
* An array representing a size: [width, height].
* @typedef {Array.<number>} ol.Size
*/
ol.Size = function(width, height) {
goog.base(this, width, height);
};
goog.inherits(ol.Size, goog.math.Size);
ol.Size;
/**
* @param {ol.Size} size Size.
* Compares sizes for equality.
* @param {ol.Size} a Size.
* @param {ol.Size} b Size.
* @return {boolean} Equals.
*/
ol.Size.prototype.equals = function(size) {
return this.width == size.width && this.height == size.height;
ol.size.equals = function(a, b) {
return a[0] == b[0] && a[1] == b[1];
};