From 3051b22a8845c9d1203ca1c6e7665c954648ef8a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 11 Dec 2012 20:14:17 +0200 Subject: [PATCH] add Bounds getSize method --- src/geometry/Bounds.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/geometry/Bounds.js b/src/geometry/Bounds.js index 24b213aa..b13d23b3 100644 --- a/src/geometry/Bounds.js +++ b/src/geometry/Bounds.js @@ -44,6 +44,10 @@ L.Bounds = L.Class.extend({ return new L.Point(this.max.x, this.min.y); }, + getSize: function () { + return this.max.subtract(this.min); + }, + contains: function (obj) { // (Bounds) or (Point) -> Boolean var min, max;