Skip to content

Commit 3300eb7

Browse files
committed
Fixed Graphics lineAlpha in Canvas Renderer.
1 parent 1ee3751 commit 3300eb7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

v3/src/gameobjects/graphics/GraphicsCanvasRenderer.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, c
7979
red = ((lineColor & 0xFF0000) >>> 16);
8080
green = ((lineColor & 0xFF00) >>> 8);
8181
blue = (lineColor & 0xFF);
82-
ctx.strokeStyle = 'rgb(' + red + ',' + green + ',' + blue + ')';
83-
ctx.globalAlpha = fillAlpha;
82+
ctx.strokeStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + lineAlpha + ')';
8483
ctx.lineWidth = lineWidth;
8584
index += 3;
8685
break;
@@ -91,8 +90,7 @@ var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, c
9190
red = ((fillColor & 0xFF0000) >>> 16);
9291
green = ((fillColor & 0xFF00) >>> 8);
9392
blue = (fillColor & 0xFF);
94-
ctx.fillStyle = 'rgb(' + red + ',' + green + ',' + blue + ')';
95-
ctx.globalAlpha = fillAlpha;
93+
ctx.fillStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + fillAlpha + ')';
9694
index += 2;
9795
break;
9896

0 commit comments

Comments
 (0)