Added clear rect to transparent canvas renderer

This commit is contained in:
Mat Groves 2014-01-24 10:26:26 +00:00
parent f127cfe1ef
commit 13ef9ea96c
3 changed files with 21 additions and 9 deletions

View file

@ -7531,11 +7531,17 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
this.context.setTransform(1,0,0,1,0,0); this.context.setTransform(1,0,0,1,0,0);
if(this.view.style.backgroundColor !== stage.backgroundColorString && !this.transparent) if(this.view.style.backgroundColor !== stage.backgroundColorString )
{ {
this.context.fillStyle = stage.backgroundColorString; if(!this.transparent)
this.context.fillRect(0, 0, this.width, this.height); {
// this.context.clearRect(0, 0, this.width, this.height); this.context.fillStyle = stage.backgroundColorString;
this.context.fillRect(0, 0, this.width, this.height);
}
else
{
this.context.clearRect(0, 0, this.width, this.height);
}
} }
//console.log(this.view.style.backgroundColor) //console.log(this.view.style.backgroundColor)

File diff suppressed because one or more lines are too long

View file

@ -154,11 +154,17 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
this.context.setTransform(1,0,0,1,0,0); this.context.setTransform(1,0,0,1,0,0);
if(this.view.style.backgroundColor !== stage.backgroundColorString && !this.transparent) if(this.view.style.backgroundColor !== stage.backgroundColorString )
{ {
this.context.fillStyle = stage.backgroundColorString; if(!this.transparent)
this.context.fillRect(0, 0, this.width, this.height); {
// this.context.clearRect(0, 0, this.width, this.height); this.context.fillStyle = stage.backgroundColorString;
this.context.fillRect(0, 0, this.width, this.height);
}
else
{
this.context.clearRect(0, 0, this.width, this.height);
}
} }
//console.log(this.view.style.backgroundColor) //console.log(this.view.style.backgroundColor)