diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index b35f4dc..8d2894e 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -217,17 +217,13 @@ this.context.fillStyle = "black"; this.context.clear(); } - - if (!this.transparent && this.clearBeforeRender) + + if (this.clearBeforeRender) { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); + if (!this.transparent) this.context.fillStyle = stage.backgroundColorString; + this.context.[(this.transparent) ? "clearRect" : "fillRect"](0, 0, this.width, this.height); } - else if (this.transparent && this.clearBeforeRender) - { - this.context.clearRect(0, 0, this.width, this.height); - } - + this.renderDisplayObject(stage); // run interaction!