The Graphics Canvas Renderer will now automatically call beginPath on the target context before processing the command stack. This has the effect of clearing off any sub-paths that may have persisted on the stack from previous Graphics objects or frames.

This commit is contained in:
Richard Davey 2018-09-04 23:33:38 +01:00
parent 4d74b99018
commit dff9bdef9f
2 changed files with 6 additions and 1 deletions

View file

@ -6,6 +6,8 @@
## Updates
* The Graphics Canvas Renderer will now automatically call `beginPath` on the target context before processing the command stack. This has the effect of clearing off any sub-paths that may have persisted on the stack from previous Graphics objects or frames. This makes it more in-line with WebGL re: expectations when calling `Graphics.clear`.
## Bug Fixes
* TileSprite.setTileScale would set the tile position by mistake, instead of the scale. Using the properties directly worked, but the method was incorrect (thanks @alexeymolchan)

View file

@ -45,7 +45,10 @@ var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, c
var green = 0;
var blue = 0;
ctx.fillStyle = '#fff';
ctx.save();
// Reset any currently active paths
ctx.beginPath();
for (var index = 0; index < commandBufferLength; ++index)
{