From c2fe826a069296acdbece1da0deaf16544f25af4 Mon Sep 17 00:00:00 2001 From: MattN-L Date: Fri, 15 Mar 2024 20:43:16 -0400 Subject: [PATCH] Fixed SetTile bug with "child" tiles --- PCK-Studio/Forms/Editor/TextureAtlasEditor.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs b/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs index 1f5caaea..68f24c98 100644 --- a/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs +++ b/PCK-Studio/Forms/Editor/TextureAtlasEditor.cs @@ -390,7 +390,10 @@ namespace PckStudio.Forms.Editor g.DrawImage(texture, dataTile.Area); } - _tiles[_selectedTile.Index] = new AtlasTile(_selectedTile.Index, _selectedTile.Area, _selectedTile.Tile, texture); + if(_selectedTile != dataTile) + _tiles[dataTile.Index] = new AtlasTile(dataTile.Index, dataTile.Area, dataTile.Tile, texture); + else + _tiles[_selectedTile.Index] = new AtlasTile(_selectedTile.Index, _selectedTile.Area, _selectedTile.Tile, texture); selectTilePictureBox.Image = texture; UpdateAtlasDisplay();