mirror of
https://github.com/photonstorm/phaser
synced 2024-12-03 18:10:10 +00:00
The alpha
value is now always set for Render Textures in canvas mode, regardless of the previous alpha value in the renderer
This commit is contained in:
parent
a1ae1744ac
commit
7fe9167657
1 changed files with 18 additions and 20 deletions
|
@ -32,26 +32,6 @@ var RenderTextureCanvasRenderer = function (renderer, renderTexture, interpolati
|
|||
// Nothing to see, so abort early
|
||||
return;
|
||||
}
|
||||
else if (renderer.currentAlpha !== alpha)
|
||||
{
|
||||
renderer.currentAlpha = alpha;
|
||||
ctx.globalAlpha = alpha;
|
||||
}
|
||||
|
||||
// Blend Mode
|
||||
|
||||
if (renderer.currentBlendMode !== renderTexture.blendMode)
|
||||
{
|
||||
renderer.currentBlendMode = renderTexture.blendMode;
|
||||
ctx.globalCompositeOperation = renderer.blendModes[renderTexture.blendMode];
|
||||
}
|
||||
|
||||
// Scale Mode
|
||||
|
||||
if (renderer.currentScaleMode !== renderTexture.scaleMode)
|
||||
{
|
||||
renderer.currentScaleMode = renderTexture.scaleMode;
|
||||
}
|
||||
|
||||
var dx = 0;
|
||||
var dy = 0;
|
||||
|
@ -81,6 +61,23 @@ var RenderTextureCanvasRenderer = function (renderer, renderTexture, interpolati
|
|||
|
||||
ctx.save();
|
||||
|
||||
ctx.globalAlpha = alpha;
|
||||
|
||||
// Blend Mode
|
||||
|
||||
if (renderer.currentBlendMode !== renderTexture.blendMode)
|
||||
{
|
||||
renderer.currentBlendMode = renderTexture.blendMode;
|
||||
ctx.globalCompositeOperation = renderer.blendModes[renderTexture.blendMode];
|
||||
}
|
||||
|
||||
// Scale Mode
|
||||
|
||||
if (renderer.currentScaleMode !== renderTexture.scaleMode)
|
||||
{
|
||||
renderer.currentScaleMode = renderTexture.scaleMode;
|
||||
}
|
||||
|
||||
if (parentMatrix !== undefined)
|
||||
{
|
||||
var matrix = parentMatrix.matrix;
|
||||
|
@ -93,6 +90,7 @@ var RenderTextureCanvasRenderer = function (renderer, renderTexture, interpolati
|
|||
ctx.scale(renderTexture.scaleX, renderTexture.scaleY);
|
||||
ctx.scale(fx, fy);
|
||||
ctx.drawImage(renderTexture.canvas, dx, dy);
|
||||
|
||||
ctx.restore();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue