diff --git a/CHANGELOG.md b/CHANGELOG.md index 43f519f..b596bb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Improvements ### MLEM.Data Improvements - Allow data texture atlas pivots and offsets to be negative +- Made RuntimeTexturePacker restore texture region name and pivot when packing Fixes - Fixed data texture atlases not allowing most characters in their region names diff --git a/MLEM.Data/RuntimeTexturePacker.cs b/MLEM.Data/RuntimeTexturePacker.cs index ac1e901..9c55c3c 100644 --- a/MLEM.Data/RuntimeTexturePacker.cs +++ b/MLEM.Data/RuntimeTexturePacker.cs @@ -199,7 +199,10 @@ namespace MLEM.Data { // invoke callbacks foreach (var request in this.alreadyPackedTextures) { var packedArea = request.PackedArea.Shrink(new Point(request.Padding, request.Padding)); - request.Result.Invoke(new TextureRegion(this.PackedTexture, packedArea)); + request.Result.Invoke(new TextureRegion(this.PackedTexture, packedArea) { + Pivot = request.Texture.Pivot, + Name = request.Texture.Name + }); if (this.disposeTextures) request.Texture.Texture.Dispose(); }