diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-04-30 01:08:07 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-04-30 02:27:38 +0800 |
| commit | be7b641955a197d55251c3cbd4a314476cf94fb3 (patch) | |
| tree | 1747230438e2daa7d8debd2f661a69ba11f4ea23 /src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java | |
| parent | 43614d50fe2d965246b8ee4522f0ece646031ae9 (diff) | |
| download | RoughlyEnoughItems-be7b641955a197d55251c3cbd4a314476cf94fb3.tar.gz RoughlyEnoughItems-be7b641955a197d55251c3cbd4a314476cf94fb3.tar.bz2 RoughlyEnoughItems-be7b641955a197d55251c3cbd4a314476cf94fb3.zip | |
Update to 20w18a and add recipe exporter
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java index a26ea36f6..86f887444 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java @@ -403,8 +403,8 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable { int_2 -= 4; } - String string_1 = this.font.method_27523(this.text.substring(this.field_2103), this.getWidth()); - this.moveCursorTo(this.font.method_27523(string_1, int_2).length() + this.field_2103, true); + String string_1 = this.font.trimToWidth(this.text.substring(this.field_2103), this.getWidth()); + this.moveCursorTo(this.font.trimToWidth(string_1, int_2).length() + this.field_2103, true); return true; } else { return false; @@ -430,7 +430,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable { int color = this.editable ? this.editableColor : this.notEditableColor; int int_4 = this.cursorMax - this.field_2103; int int_5 = this.cursorMin - this.field_2103; - String string_1 = this.font.method_27523(this.text.substring(this.field_2103), this.getWidth()); + String string_1 = this.font.trimToWidth(this.text.substring(this.field_2103), this.getWidth()); boolean boolean_1 = int_4 >= 0 && int_4 <= string_1.length(); boolean boolean_2 = this.focused && this.focusedTicks / 6 % 2 == 0 && boolean_1; int x = this.hasBorder ? this.bounds.x + 4 : this.bounds.x; @@ -469,14 +469,14 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable { // Render selection overlay if (int_5 != int_4) { - int int_10 = x + this.font.getStringWidth(string_1.substring(0, int_5)); + int int_10 = x + this.font.getWidth(string_1.substring(0, int_5)); this.renderSelection(matrices, int_9, y - 1, int_10 - 1, y + 9, color); } } } protected void renderSuggestion(MatrixStack matrices, int x, int y) { - this.font.drawWithShadow(matrices, this.font.method_27523(this.suggestion, this.getWidth()), x, y, -8355712); + this.font.drawWithShadow(matrices, this.font.trimToWidth(this.suggestion, this.getWidth()), x, y, -8355712); } protected void renderSelection(MatrixStack matrices, int x1, int y1, int x2, int y2, int color) { @@ -596,10 +596,10 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable { } int int_3 = this.getWidth(); - String string_1 = this.font.method_27523(this.text.substring(this.field_2103), int_3); + String string_1 = this.font.trimToWidth(this.text.substring(this.field_2103), int_3); int int_4 = string_1.length() + this.field_2103; if (this.cursorMin == this.field_2103) { - this.field_2103 -= this.font.method_27524(this.text, int_3, true).length(); + this.field_2103 -= this.font.trimToWidth(this.text, int_3, true).length(); } if (this.cursorMin > int_4) { @@ -626,7 +626,7 @@ public class TextFieldWidget extends WidgetWithBounds implements Tickable { } public int method_1889(int int_1) { - return int_1 > this.text.length() ? this.bounds.x : this.bounds.x + this.font.getStringWidth(this.text.substring(0, int_1)); + return int_1 > this.text.length() ? this.bounds.x : this.bounds.x + this.font.getWidth(this.text.substring(0, int_1)); } } |
