When building the Tiles of a TileSet with spacing > 0, the tile index was used instead of the x,y position, offsetting everything on every iteration by 1 extra pixel.
Also, incrementing the index on every loop while calculating the width/height with spacing was offsetting the total size (1 tile smaller in each direction with a spacing of 1).
When building the Tiles of a TileSet with spacing > 0, the tile index was used instead of the x,y position, offsetting everything on every iteration by 1 extra pixel.
Also, incrementing the index on every loop while calculating the width/height with spacing was offsetting the total size (1 tile smaller in each direction with a spacing of 1).