diff --git a/Ozzyria.Gryp/Models/Data/Layer.cs b/Ozzyria.Gryp/Models/Data/Layer.cs index 2ef689d..8bad7c9 100644 --- a/Ozzyria.Gryp/Models/Data/Layer.cs +++ b/Ozzyria.Gryp/Models/Data/Layer.cs @@ -434,7 +434,7 @@ public void PaintArea(TileBoundary? region, Tile tileData, int originX, int orig var fillDown = GetTileData(toFillX, toFillY + 1)?.Equal(toFillTile) ?? false; var fillUp = GetTileData(toFillX, toFillY - 1)?.Equal(toFillTile) ?? false; - PushTile(tileData, toFillX, toFillY); + PushTile(tileData.Clone(), toFillX, toFillY); toFill.RemoveAt(0); if (fillRight) diff --git a/Ozzyria.Gryp/Models/Data/Tile.cs b/Ozzyria.Gryp/Models/Data/Tile.cs index 316fa2c..07690a5 100644 --- a/Ozzyria.Gryp/Models/Data/Tile.cs +++ b/Ozzyria.Gryp/Models/Data/Tile.cs @@ -7,6 +7,13 @@ internal class Tile { public List DrawableIds { get; set; } = new List(); + public Tile Clone() + { + Tile tile = new Tile(); + tile.DrawableIds.AddRange(DrawableIds); + return tile; + } + public bool Equal(Tile other) { if(DrawableIds.Count <= 0 && other.DrawableIds.Count <= 0) return true;