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