Skip to content

Commit

Permalink
Fixed font scaling issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
raeleus committed Jan 31, 2023
1 parent 644989e commit ffb1832
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Skin Composer Version 56 ###
*
* Fixed font scaling issues.

### Skin Composer Version 55a ###
* Fixed build error preventing Skin Composer from starting.
Expand Down
10 changes: 5 additions & 5 deletions core/src/com/ray3k/skincomposer/dialog/DialogFonts.java
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ private void changeSettingsDialog(final FontData font) {
protected void result(Object object) {
if ((boolean) object) {
var scaling = Integer.parseInt(scalingField.getText());
if (scaling < 1) scaling = 1;
if (scaling < 1) scaling = -1;
changeFontSettings(font, nameField.getText(), scaling, markupCheckBox.isChecked(), flipCheckBox.isChecked());
}
}
Expand Down Expand Up @@ -690,7 +690,7 @@ public Dialog show(Stage stage) {
LabelStyle previewStyle = new LabelStyle();
previewStyle.font = new BitmapFont(font.file, font.isFlip());
final var previewCapHeight = previewStyle.font.getCapHeight();
previewStyle.font.getData().setScale(font.getScaling() / previewStyle.font.getCapHeight());
if (font.getScaling() != -1) previewStyle.font.getData().setScale(font.getScaling() / previewStyle.font.getCapHeight());

dialog.getContentTable().row();
Table table = new Table();
Expand Down Expand Up @@ -741,7 +741,7 @@ public void changed(ChangeListener.ChangeEvent event, Actor actor) {
if (c == '\n') {
if (!okButton.isDisabled()) {
var scaling = Integer.parseInt(scalingField.getText());
if (scaling < 1) scaling = 1;
if (scaling < 1) scaling = -1;
changeFontSettings(font, textField1.getText(), scaling, markupCheckBox.isChecked(), flipCheckBox.isChecked());
dialog.hide();
}
Expand Down Expand Up @@ -1170,7 +1170,7 @@ protected void result(Object object) {
String name = nameField.getText();

var scaling = Integer.parseInt(scalingField.getText());
if (scaling < 1) scaling = 1;
if (scaling < 1) scaling = -1;
addFont(name, MathUtils.round(scaling), markupCheckBox.isChecked(), flipCheckBox.isChecked(), fileHandle);
}
}
Expand All @@ -1197,7 +1197,7 @@ public boolean remove() {
if (!button.isDisabled()) {
String name1 = textField1.getText();
var scaling = Integer.parseInt(scalingField.getText());
if (scaling < 1) scaling = 1;
if (scaling < 1) scaling = -1;
if (addFont(name1, MathUtils.round(scaling), markupCheckBox.isChecked(), flipCheckBox.isChecked(), fileHandle)) {
nameDialog.hide();
}
Expand Down

0 comments on commit ffb1832

Please sign in to comment.