fix wx canvas fillRect clearColor (#3055)

This commit is contained in:
PP
2018-08-08 15:57:31 +08:00
committed by pandamicro
parent 045a416b56
commit 205f0734a8
@@ -56,8 +56,11 @@ RenderComponentWalker.prototype = {
visit (scene) {
let ctx = this._device._ctx;
let canvas = this._device._canvas;
ctx.fillStyle = cc.Camera.main.backgroundColor.toHEX("#rrggbbaa");
let color = cc.Camera.main.backgroundColor;
let rgba = `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a/255})`;
ctx.fillStyle = rgba;
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.fillRect(0, 0, canvas.width, canvas.height);
this._device._stats.drawcalls = 0;