aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2022-12-13 22:36:19 +0000
committerisXander <xandersmith2008@gmail.com>2022-12-13 22:36:35 +0000
commit3d1f7eb6c149c14ef9eea98d2d8caa6768f8c51c (patch)
tree84ec768e3e0d9a7cd56d4c8a9bc833d4760a34b3
parent26693fe5396b6b7830804837c426121017ca215a (diff)
downloadYetAnotherConfigLib-3d1f7eb6c149c14ef9eea98d2d8caa6768f8c51c.tar.gz
YetAnotherConfigLib-3d1f7eb6c149c14ef9eea98d2d8caa6768f8c51c.tar.bz2
YetAnotherConfigLib-3d1f7eb6c149c14ef9eea98d2d8caa6768f8c51c.zip
fix #44
-rw-r--r--build.gradle.kts4
-rw-r--r--src/client/java/dev/isxander/yacl/gui/controllers/ColorController.java2
-rw-r--r--src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java8
3 files changed, 6 insertions, 8 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index e0a7f3f..4962059 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -147,9 +147,7 @@ if (hasProperty("CURSEFORGE_TOKEN") && curseforgeId.isNotEmpty()) {
id = curseforgeId
releaseType = "release"
- addGameVersion("1.19")
- addGameVersion("1.19.1")
- addGameVersion("1.19.2")
+ addGameVersion("1.19.3")
addGameVersion("Fabric")
addGameVersion("Java 17")
diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/ColorController.java b/src/client/java/dev/isxander/yacl/gui/controllers/ColorController.java
index 7ed9ec1..9626a9e 100644
--- a/src/client/java/dev/isxander/yacl/gui/controllers/ColorController.java
+++ b/src/client/java/dev/isxander/yacl/gui/controllers/ColorController.java
@@ -184,7 +184,7 @@ public class ColorController implements IStringController<Color> {
}
@Override
- protected int getDefaultCarotPos() {
+ protected int getDefaultCaretPos() {
return colorController.allowAlpha() ? 3 : 1;
}
diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java b/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java
index da33aec..b4358f4 100644
--- a/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java
+++ b/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java
@@ -54,7 +54,7 @@ public class StringControllerElement extends ControllerWidget<IStringController<
matrices.push();
int textX = getDimension().xLimit() - textRenderer.getWidth(valueText) + renderOffset - getXPadding();
matrices.translate(textX, getTextY(), 0);
- GuiUtils.enableScissor(inputFieldBounds.x(), inputFieldBounds.y(), inputFieldBounds.width() + 1, inputFieldBounds.height() + 2);
+ GuiUtils.enableScissor(inputFieldBounds.x(), inputFieldBounds.y() - 2, inputFieldBounds.width() + 1, inputFieldBounds.height() + 4);
textRenderer.drawWithShadow(matrices, valueText, 0, 0, getValueColor());
matrices.pop();
@@ -90,7 +90,7 @@ public class StringControllerElement extends ControllerWidget<IStringController<
inputFieldFocused = true;
if (!inputFieldBounds.isPointInside((int) mouseX, (int) mouseY)) {
- caretPos = getDefaultCarotPos();
+ caretPos = getDefaultCaretPos();
} else {
// gets the appropriate caret position for where you click
int textX = (int) mouseX - (inputFieldBounds.xLimit() - textRenderer.getWidth(getValueText()));
@@ -99,7 +99,7 @@ public class StringControllerElement extends ControllerWidget<IStringController<
for (char ch : inputField.toCharArray()) {
pos++;
int charLength = textRenderer.getWidth(String.valueOf(ch));
- if (currentWidth + charLength / 2 > textX) { // if more than half way past the characters select in front of that char
+ if (currentWidth + charLength / 2 > textX) { // if more than halfway past the characters select in front of that char
caretPos = pos;
break;
} else if (pos == inputField.length() - 1) {
@@ -119,7 +119,7 @@ public class StringControllerElement extends ControllerWidget<IStringController<
return false;
}
- protected int getDefaultCarotPos() {
+ protected int getDefaultCaretPos() {
return inputField.length();
}