von-grid icon indicating copy to clipboard operation
von-grid copied to clipboard

removeAllTiles function doesn't remove all tiles

Open sacplex opened this issue 3 years ago • 0 comments

Hi,

I found an issue when removing all the tiles, where only some of the tiles are been removed. I believe this is due to the element being shifted down by one. The index variable t is not shifting after each removal.

for (var e = this.tileGroup.children, t = 0; t < e.length; t++)
  this.tileGroup.remove(e[t]);

However, was able to fix with the following code,

var e = this.tileGroup.children
while(e.length>0)
  e.pop();

sacplex avatar Apr 03 '21 07:04 sacplex