TextureAtlasEditor - Added index check when constructing tiles list

This commit is contained in:
miku-666
2023-08-10 13:55:07 +02:00
parent 748f5921ed
commit ce1447cec3

View File

@@ -96,7 +96,9 @@ namespace PckStudio
originalPictureBox.Image = atlas;
var images = atlas.CreateImageList(_areaSize, _imageLayout);
var tiles = images.enumerate().Select(v => new AtlasTile(v.index, GetAtlasArea(v.index, _rowCount, _columnCount, _areaSize, _imageLayout), tileInfos[v.index], v.type));
var tiles = images.enumerate().Select(
v => new AtlasTile(v.index, GetAtlasArea(v.index, _rowCount, _columnCount, _areaSize, _imageLayout), tileInfos.IndexInRange(v.index) ? tileInfos[v.index] : null, v.type)
);
_tiles = new List<AtlasTile>(tiles);
SelectedIndex = 0;