diff --git a/CHANGES.md b/CHANGES.md index 432b9705..2ccff63e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ * Preview text adapts to available glyphs in Fonts Dialog. * Prevent users from selecting a parent listed further down the styles list which would cause an error when loaded in game. Resolves #90 * Added setting to allow showing the full path in the Recent Files menu (Thanks Grisgram). Resolves #91 +* Fixed exported skins overwriting content padding when minWidth/minHeight is specified. Resolves #93 ### Skin Composer Version 42 ### * Fixed NPE when loading a project with a place holder FreeType font. diff --git a/core/src/com/ray3k/skincomposer/data/JsonData.java b/core/src/com/ray3k/skincomposer/data/JsonData.java index e8a8f3b9..2c464d13 100644 --- a/core/src/com/ray3k/skincomposer/data/JsonData.java +++ b/core/src/com/ray3k/skincomposer/data/JsonData.java @@ -764,6 +764,12 @@ public Array writeFile(FileHandle fileHandle) { else json.writeValue("minWidth", Utils.imageDimensions(drawable.file).x); if (!MathUtils.isEqual(drawable.minHeight, -1)) json.writeValue("minHeight", drawable.minHeight); else json.writeValue("minHeight", Utils.imageDimensions(drawable.file).y); + + var atlasDrawable = atlasData.getDrawablePairs().get(drawable); + json.writeValue("leftWidth", atlasDrawable.getLeftWidth()); + json.writeValue("rightWidth", atlasDrawable.getRightWidth()); + json.writeValue("topHeight", atlasDrawable.getTopHeight()); + json.writeValue("bottomHeight", atlasDrawable.getBottomHeight()); json.writeObjectEnd(); } json.writeObjectEnd();