mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
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:
parent
027c8b7007
commit
3f5de71add
1 changed files with 4 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue