Add ol.size.hasArea

This commit is contained in:
Tim Schaub
2015-04-22 09:58:42 -06:00
parent 046ff764df
commit 1f07dfc343
3 changed files with 29 additions and 18 deletions
+10
View File
@@ -41,6 +41,16 @@ ol.size.equals = function(a, b) {
};
/**
* Determines if a size has a positive area.
* @param {ol.Size} size The size to test.
* @return {boolean} The size has a positive area.
*/
ol.size.hasArea = function(size) {
return size[0] > 0 && size[1] > 0;
};
/**
* Returns a size scaled by a ratio. The result will be an array of integers.
* @param {ol.Size} size Size.