aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui/elements/text
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-29 11:20:56 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-29 11:20:56 +0200
commitd5c493075b9fc50edc7d8a22efeed08310d9ffe2 (patch)
treea97d5e6727f49786ca6b6126ebe705b05609a2bf /src/main/java/cc/polyfrost/oneconfig/gui/elements/text
parenta099d4a19953eb8d0fa92b2dd1f47cb6cb449ebb (diff)
parent98eedb30ac2f4e6ab9b0b1b04127e4afdcba0315 (diff)
downloadOneConfig-d5c493075b9fc50edc7d8a22efeed08310d9ffe2.tar.gz
OneConfig-d5c493075b9fc50edc7d8a22efeed08310d9ffe2.tar.bz2
OneConfig-d5c493075b9fc50edc7d8a22efeed08310d9ffe2.zip
Merge branch 'master' of github.com:Polyfrost/OneConfig
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements/text')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java
index a7dbf62..ff82879 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java
@@ -127,18 +127,18 @@ public class TextInputField extends BasicElement {
float width;
StringBuilder s = new StringBuilder();
if (multiLine) {
- wrappedText = TextUtils.wrapText(vg, input, this.width - 24, 14f, Fonts.REGULAR);
+ wrappedText = TextUtils.wrapText(vg, input, this.width - 24, 14f, Fonts.REGULAR.font);
lines = wrappedText.size();
if (!toggled) caretPos = wrappedText.get(wrappedText.size() - 1).length();
int caretLine = (int) MathUtils.clamp(getCaretLine(caretPos), 0, wrappedText.size() - 1);
- width = RenderManager.getTextWidth(vg, wrappedText.get(caretLine).substring(0, getLineCaret(caretPos, caretLine)), 14f, Fonts.REGULAR);
+ width = RenderManager.getTextWidth(vg, wrappedText.get(caretLine).substring(0, getLineCaret(caretPos, caretLine)), 14f, Fonts.REGULAR.font);
} else if (!password) {
- width = RenderManager.getTextWidth(vg, input.substring(0, caretPos), 14f, Fonts.REGULAR);
+ width = RenderManager.getTextWidth(vg, input.substring(0, caretPos), 14f, Fonts.REGULAR.font);
} else {
for (int i = 0; i < input.length(); i++) {
s.append("*");
}
- width = RenderManager.getTextWidth(vg, s.substring(0, caretPos), 14f, Fonts.REGULAR);
+ width = RenderManager.getTextWidth(vg, s.substring(0, caretPos), 14f, Fonts.REGULAR.font);
}
if (hovered) {
while (Mouse.next()) {
@@ -222,11 +222,11 @@ public class TextInputField extends BasicElement {
if (input.equals("")) {
if (multiLine) {
- RenderManager.drawString(vg, defaultText, x + 12, y + 16, color, 14f, Fonts.REGULAR);
+ RenderManager.drawText(vg, defaultText, x + 12, y + 16, color, 14f, Fonts.REGULAR);
} else if (!centered) {
- RenderManager.drawString(vg, defaultText, x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
+ RenderManager.drawText(vg, defaultText, x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
} else {
- RenderManager.drawString(vg, defaultText, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
+ RenderManager.drawText(vg, defaultText, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
}
}
@@ -234,16 +234,16 @@ public class TextInputField extends BasicElement {
if (multiLine) {
int textY = y + 20;
for (String line : wrappedText) {
- RenderManager.drawString(vg, line, x + 12, textY, color, 14f, Fonts.REGULAR);
+ RenderManager.drawText(vg, line, x + 12, textY, color, 14f, Fonts.REGULAR);
textY += 24;
}
} else if (!centered) {
- RenderManager.drawString(vg, input, x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
+ RenderManager.drawText(vg, input, x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
} else {
- RenderManager.drawString(vg, input, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
+ RenderManager.drawText(vg, input, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
}
} else {
- RenderManager.drawString(vg, s.toString(), x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
+ RenderManager.drawText(vg, s.toString(), x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR);
}
ScissorManager.resetScissor(vg, scissor);
} catch (