Fixe Phaser.Rectangle.aabb()

Number.MIN_VALUE does not return the most negative number, but rather the smallest representable number above 0.  As a result, Phaser.Rectangle.aabb() did not work correctly when the points had negative values.
This commit is contained in:
fillmoreb 2016-06-08 16:14:30 -06:00
parent 027c8b7007
commit 3f5de71add

View file

@ -975,10 +975,10 @@ Phaser.Rectangle.aabb = function(points, out) {
out = new Phaser.Rectangle();
}
var xMax = Number.MIN_VALUE,
xMin = Number.MAX_VALUE,
yMax = Number.MIN_VALUE,
yMin = Number.MAX_VALUE;
var xMax = Number.NEGATIVE_INFINITY,
xMin = Number.POSITIVE_INFINITY,
yMax = Number.NEGATIVE_INFINITY,
yMin = Number.POSITIVE_INFINITY;
points.forEach(function(point) {
if (point.x > xMax) {