Skip to content

Commit bc9d351

Browse files
committed
When using RenderTexture.fill, the alpha argument would be ignored in Canvas mode. It's now used when filling the RenderTexture.
1 parent 83f3f9c commit bc9d351

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/gameobjects/rendertexture/RenderTexture.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,25 +409,25 @@ var RenderTexture = new Class({
409409
{
410410
if (alpha === undefined) { alpha = 1; }
411411

412-
var ur = ((rgb >> 16)|0) & 0xff;
413-
var ug = ((rgb >> 8)|0) & 0xff;
414-
var ub = (rgb|0) & 0xff;
412+
var r = ((rgb >> 16) | 0) & 0xff;
413+
var g = ((rgb >> 8) | 0) & 0xff;
414+
var b = (rgb | 0) & 0xff;
415415

416416
if (this.gl)
417417
{
418418
this.renderer.setFramebuffer(this.framebuffer, true);
419419

420420
var gl = this.gl;
421421

422-
gl.clearColor(ur / 255.0, ug / 255.0, ub / 255.0, alpha);
422+
gl.clearColor(r / 255, g / 255, b / 255, alpha);
423423

424424
gl.clear(gl.COLOR_BUFFER_BIT);
425425

426426
this.renderer.setFramebuffer(null, true);
427427
}
428428
else
429429
{
430-
this.context.fillStyle = 'rgb(' + ur + ',' + ug + ',' + ub + ')';
430+
this.context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')';
431431
this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
432432
}
433433

0 commit comments

Comments
 (0)