Skip to content

Commit

Permalink
Prevent crash when using fonts in a relative resource project. Resolves
Browse files Browse the repository at this point in the history
  • Loading branch information
raeleus committed Mar 4, 2024
1 parent a124ec4 commit fc7cbd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Refactored Scene Composer and fixed various errors. Resolves #135. Thanks deviodesign!
* Added more finite control of scale in settings. Thanks ChinQingl
* Fixed FreeTypeFontGenerator from creating glyphs with the wrong page index if there are multiple pages
* Prevent crash when using fonts in a relative resource project. Resolves #143. Thanks SonicNorg!

### Skin Composer Version 56 ###
* Fixed font scaling issues.
Expand Down
6 changes: 4 additions & 2 deletions core/src/com/ray3k/skincomposer/dialog/DialogFonts.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,11 @@ public boolean touchDown(InputEvent event, float x, float y, int pointer, int bu
if (bf.imagePaths.length > 0) {
FileHandle file = new FileHandle(bf.imagePaths[0]);
if (!file.exists()) {
file = bf.fontFile.sibling(bf.fontFile.nameWithoutExtension() + ".png");
file = font.file.sibling(bf.fontFile.nameWithoutExtension() + ".png");
}
if (Utils.brightness(Utils.averageEdgeColor(file)) < .5f) {
if (!file.exists()) {
bg.setColor(Color.BLACK);
} else if (Utils.brightness(Utils.averageEdgeColor(file)) < .5f) {
bg.setColor(Color.WHITE);
} else {
bg.setColor(Color.BLACK);
Expand Down

0 comments on commit fc7cbd8

Please sign in to comment.