patch for PixiPatch so render masks again

This commit is contained in:
Georgios Kaleadis 2014-02-18 11:26:10 +01:00
parent 68d5c73fea
commit 16dc2c1597

View file

@ -134,29 +134,34 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, rend
} }
else if (displayObject instanceof PIXI.FilterBlock) else if (displayObject instanceof PIXI.FilterBlock)
{ {
if(displayObject.data instanceof PIXI.Graphics)
{
var mask = displayObject.data;
if(displayObject.open) if(displayObject.open)
{ {
this.context.save(); this.context.save();
var cacheAlpha = displayObject.mask.alpha; var cacheAlpha = mask.alpha;
var maskTransform = displayObject.mask.worldTransform; var maskTransform = mask.worldTransform;
this.context.setTransform(maskTransform[0], maskTransform[3], maskTransform[1], maskTransform[4], maskTransform[2], maskTransform[5]) this.context.setTransform(maskTransform[0], maskTransform[3], maskTransform[1], maskTransform[4], maskTransform[2], maskTransform[5]);
displayObject.mask.worldAlpha = 0.5; mask.worldAlpha = 0.5;
this.context.worldAlpha = 0; this.context.worldAlpha = 0;
PIXI.CanvasGraphics.renderGraphicsMask(displayObject.mask, this.context); PIXI.CanvasGraphics.renderGraphicsMask(mask, this.context);
this.context.clip(); this.context.clip();
displayObject.mask.worldAlpha = cacheAlpha; mask.worldAlpha = cacheAlpha;
} }
else else
{ {
this.context.restore(); this.context.restore();
} }
} }
}
// count++ // count++
displayObject = displayObject._iNext; displayObject = displayObject._iNext;
} }