Add ol.Rectangle.getSize
This commit is contained in:
@@ -2,6 +2,7 @@ goog.provide('ol.Rectangle');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.math.Coordinate');
|
||||
goog.require('goog.math.Size');
|
||||
|
||||
|
||||
|
||||
@@ -78,3 +79,11 @@ ol.Rectangle.prototype.getCenter = function() {
|
||||
return new goog.math.Coordinate(
|
||||
(this.minX + this.maxX) / 2, (this.minY + this.maxY) / 2);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {goog.math.Size} Size.
|
||||
*/
|
||||
ol.Rectangle.prototype.getSize = function() {
|
||||
return new goog.math.Size(this.maxX - this.minX, this.maxY - this.minY);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user