diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements/text')
| -rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java | 2 | ||||
| -rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java index d7e29f5..5162ecb 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java @@ -27,7 +27,7 @@ public class NumberInputField extends TextInputField { } @Override - public void draw(long vg, int x, int y) { + public void draw(long vg, float x, float y) { super.errored = false; if(disabled) RenderManager.setAlpha(vg, 0.5f); RenderManager.drawRoundedRect(vg, x + width + 4, y, 12, 28, Colors.GRAY_500, 6f); 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 054915c..3c2cb1c 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 @@ -26,7 +26,7 @@ public class TextInputField extends BasicElement { protected boolean password; protected int caretPos; - protected int x, y; + protected float x, y; protected float start, end; protected int startLine, endLine; protected long vg; @@ -95,7 +95,7 @@ public class TextInputField extends BasicElement { } @Override - public void draw(long vg, int x, int y) { + public void draw(long vg, float x, float y) { this.x = x; this.y = y; this.vg = vg; @@ -206,12 +206,12 @@ public class TextInputField extends BasicElement { if(disabled) RenderManager.setAlpha(vg, 0.5f); if (toggled) { if (multiLine) { - int lineY = y + 20 + getCaretLine(caretPos) * 24; + float lineY = y + 20 + getCaretLine(caretPos) * 24; RenderManager.drawLine(vg, x + width + 12, lineY - 10, x + width + 12, lineY + 10, 1, Colors.WHITE); } else if (!centered) { - RenderManager.drawLine(vg, x + width + 12, (float) y + height / 2f - 10, x + width + 12, (float) y + height / 2f + 10, 1, Colors.WHITE); + RenderManager.drawLine(vg, x + width + 12, y + height / 2f - 10, x + width + 12, y + height / 2f + 10, 1, Colors.WHITE); } else { - RenderManager.drawLine(vg, x + this.width / 2f - halfTextWidth + width, (float) y + height / 2f - 10, x + this.width / 2f - halfTextWidth + width, (float) y + height / 2f + 10, 1, Colors.WHITE); + RenderManager.drawLine(vg, x + this.width / 2f - halfTextWidth + width, y + height / 2f - 10, x + this.width / 2f - halfTextWidth + width, y + height / 2f + 10, 1, Colors.WHITE); } } @@ -228,7 +228,7 @@ public class TextInputField extends BasicElement { if (!password) { if (multiLine) { - int textY = y + 20; + float textY = y + 20; for (String line : wrappedText) { RenderManager.drawText(vg, line, x + 12, textY, color, 14f, Fonts.REGULAR); textY += 24; @@ -453,7 +453,7 @@ public class TextInputField extends BasicElement { } } - private int calculatePos(int pos, String string) { + private int calculatePos(float pos, String string) { if (centered) pos -= 12; String s1 = ""; int i; |
