mirror of
https://github.com/photonstorm/phaser
synced 2024-12-03 18:10:10 +00:00
Fix for bug related to Issue #4737
- When removing a layer from a tilemap, layerIndex can become invalid - Added loop to fix any existing tilemapLayer.layerIndex vales
This commit is contained in:
parent
c25331cf30
commit
13b6d6d5ae
1 changed files with 7 additions and 0 deletions
|
@ -1564,6 +1564,13 @@ var Tilemap = new Class({
|
|||
if (index !== null)
|
||||
{
|
||||
SpliceOne(this.layers, index);
|
||||
for (var i = index; i < this.layers.length; i++)
|
||||
{
|
||||
if (this.layers[i].tilemapLayer)
|
||||
{
|
||||
this.layers[i].tilemapLayer.layerIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.currentLayerIndex === index)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue