Added renderable check to Pixi.Sprite.

This commit is contained in:
photonstorm 2014-11-18 12:36:11 +00:00
parent 683f1a3a10
commit 395171b660

View file

@ -271,7 +271,7 @@ PIXI.Sprite.prototype.getBounds = function(matrix)
PIXI.Sprite.prototype._renderWebGL = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
if(!this.visible || this.alpha <= 0)return;
if (!this.visible || this.alpha <= 0 || !this.renderable) return;
var i,j;
@ -334,7 +334,7 @@ PIXI.Sprite.prototype._renderWebGL = function(renderSession)
PIXI.Sprite.prototype._renderCanvas = function(renderSession)
{
// If the sprite is not visible or the alpha is 0 then no need to render this element
if (this.visible === false || this.alpha === 0 || this.texture.crop.width <= 0 || this.texture.crop.height <= 0) return;
if (this.visible === false || this.alpha === 0 || this.renderable === false || this.texture.crop.width <= 0 || this.texture.crop.height <= 0) return;
if (this.blendMode !== renderSession.currentBlendMode)
{