Swapped to using Number.MAX_VALUE so repeat -1 now works properly in IE11 and below.

This commit is contained in:
Richard Davey 2018-01-18 14:59:32 +00:00
parent 86fe054c63
commit d46662cd46
7 changed files with 9 additions and 9 deletions

View file

@ -282,8 +282,8 @@ var Path = new Class({
if (out === undefined) { out = new Rectangle(); }
if (accuracy === undefined) { accuracy = 16; }
out.x = Number.MAX_SAFE_INTEGER;
out.y = Number.MAX_SAFE_INTEGER;
out.x = Number.MAX_VALUE;
out.y = Number.MAX_VALUE;
var bounds = new Rectangle();
var maxRight = Number.MIN_SAFE_INTEGER;

View file

@ -180,7 +180,7 @@ var Animation = new Class({
var anim = this.currentAnim;
// Should give us 9,007,199,254,740,991 safe repeats
this.repeatCounter = (this._repeat === -1) ? Number.MAX_SAFE_INTEGER : this._repeat;
this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat;
anim.getFirstTick(this);

View file

@ -28,8 +28,8 @@ var FromPoints = function (points, out)
return out;
}
var minX = Number.MAX_SAFE_INTEGER;
var minY = Number.MAX_SAFE_INTEGER;
var minX = Number.MAX_VALUE;
var minY = Number.MAX_VALUE;
var maxX = Number.MIN_SAFE_INTEGER;
var maxY = Number.MIN_SAFE_INTEGER;

View file

@ -204,7 +204,7 @@ var World = new Class({
{
var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 });
graphic.setZ(Number.MAX_SAFE_INTEGER);
graphic.setZ(Number.MAX_VALUE);
this.debugGraphic = graphic;

View file

@ -4,7 +4,7 @@ var Closest = function (source)
{
var bodies = this.tree.all();
var min = Number.MAX_SAFE_INTEGER;
var min = Number.MAX_VALUE;
var closest = null;
var x = source.x;
var y = source.y;

View file

@ -218,7 +218,7 @@ var World = new Class({
{
var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 });
graphic.setZ(Number.MAX_SAFE_INTEGER);
graphic.setZ(Number.MAX_VALUE);
this.debugGraphic = graphic;

View file

@ -223,7 +223,7 @@ var World = new Class({
{
var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 });
graphic.setZ(Number.MAX_SAFE_INTEGER);
graphic.setZ(Number.MAX_VALUE);
this.debugGraphic = graphic;