Skip to content

Commit

Permalink
Fixed exported skins overwriting content padding when minWidth/minHei…
Browse files Browse the repository at this point in the history
…ght is specified. Resolves #93
  • Loading branch information
raeleus committed Jan 27, 2021
1 parent 029b1b0 commit ef92f09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions core/src/com/ray3k/skincomposer/data/JsonData.java
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,12 @@ public Array<String> 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();
Expand Down

0 comments on commit ef92f09

Please sign in to comment.