Protect against NaN rotation values
Throws an Error if a DisplayObject's rotation was set to NaN. Without this check, Sprite's textures could disappear silently, with no reference to the improper rotation value as the culprit.
This commit is contained in:
parent
9509f43163
commit
53ccc8128b
1 changed files with 4 additions and 1 deletions
|
@ -402,6 +402,9 @@ PIXI.DisplayObject.prototype.updateTransform = function()
|
|||
// TODO OPTIMIZE THIS!! with dirty
|
||||
if(this.rotation !== this.rotationCache)
|
||||
{
|
||||
if(isNaN(parseFloat(this.rotation)))
|
||||
throw new Error('DisplayObject rotation values must be numeric.');
|
||||
|
||||
this.rotationCache = this.rotation;
|
||||
this._sr = Math.sin(this.rotation);
|
||||
this._cr = Math.cos(this.rotation);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue