Merge branch 'master' of git@github.com:CloudMade/Leaflet.git

This commit is contained in:
Mourner 2011-07-13 14:51:10 +03:00
commit cf83c2e146
3 changed files with 12 additions and 1 deletions

View File

@ -24,6 +24,7 @@ Leaflet Changelog
* Fixed a bug where static properties of a child class would not override the parent ones. * Fixed a bug where static properties of a child class would not override the parent ones.
* Fixed broken popup `closePopup` option (by [@jgerigmeyer](https://github.com/jgerigmeyer)). * Fixed broken popup `closePopup` option (by [@jgerigmeyer](https://github.com/jgerigmeyer)).
* Fixed a bug that caused en error when dragging marker with icon without shadow (by [@anru](https://github.com/anru)). [#178](https://github.com/CloudMade/Leaflet/issues/178) * Fixed a bug that caused en error when dragging marker with icon without shadow (by [@anru](https://github.com/anru)). [#178](https://github.com/CloudMade/Leaflet/issues/178)
* Fixed a typo in `Bounds` `contains` method (by [@anru](https://github.com/anru)). [#180](https://github.com/CloudMade/Leaflet/pull/180)
## 0.2.1 (2011-06-18) ## 0.2.1 (2011-06-18)

View File

@ -40,4 +40,14 @@ describe('Bounds', function() {
expect(a.getCenter()).toEqual(new L.Point(22, 26)); expect(a.getCenter()).toEqual(new L.Point(22, 26));
}); });
}); });
describe('#contains', function() {
it('should contains other bounds or point', function() {
a.extend(new L.Point(50, 10));
expect(a.contains(b)).toBeTruthy();
expect(b.contains(a)).toBeFalsy();
expect(a.contains(new L.Point(24, 25))).toBeTruthy();
expect(a.contains(new L.Point(54, 65))).toBeFalsy();
});
});
}); });

View File

@ -37,7 +37,7 @@ L.Bounds = L.Class.extend({
min = obj.min; min = obj.min;
max = obj.max; max = obj.max;
} else { } else {
max = max = obj; min = max = obj;
} }
return (min.x >= this.min.x) && return (min.x >= this.min.x) &&