mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 22:48:34 +00:00
TileLayer - globalCompositionOperation set once
This might fix a safari issue; it also avoids repeatedly setting the [same] composition operation and saving/loading context states.
This commit is contained in:
parent
1bf3f08d8d
commit
92a20a5f5f
1 changed files with 3 additions and 3 deletions
|
@ -70,6 +70,9 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) {
|
|||
*/
|
||||
this.context = this.canvas.getContext('2d');
|
||||
|
||||
// Required for canvas-shifting to avoid alpha artifacts
|
||||
this.context.globalCompositeOperation = 'copy';
|
||||
|
||||
/**
|
||||
* Required Pixi var.
|
||||
* @property {PIXI.BaseTexture} baseTexture
|
||||
|
@ -673,10 +676,7 @@ Phaser.TilemapLayer.prototype.shiftCanvas = function (context, x, y)
|
|||
sy = 0;
|
||||
}
|
||||
|
||||
context.save();
|
||||
context.globalCompositeOperation = 'copy';
|
||||
context.drawImage(canvas, dx, dy, copyW, copyH, sx, sy, copyW, copyH);
|
||||
context.restore();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue