@@ -54,7 +54,7 @@ protected void drawValueText(MatrixStack matrices, int mouseX, int mouseY, float
5454 matrices .push ();
5555 int textX = getDimension ().xLimit () - textRenderer .getWidth (valueText ) + renderOffset - getXPadding ();
5656 matrices .translate (textX , getTextY (), 0 );
57- GuiUtils .enableScissor (inputFieldBounds .x (), inputFieldBounds .y (), inputFieldBounds .width () + 1 , inputFieldBounds .height () + 2 );
57+ GuiUtils .enableScissor (inputFieldBounds .x (), inputFieldBounds .y () - 2 , inputFieldBounds .width () + 1 , inputFieldBounds .height () + 4 );
5858 textRenderer .drawWithShadow (matrices , valueText , 0 , 0 , getValueColor ());
5959 matrices .pop ();
6060
@@ -90,7 +90,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
9090 inputFieldFocused = true ;
9191
9292 if (!inputFieldBounds .isPointInside ((int ) mouseX , (int ) mouseY )) {
93- caretPos = getDefaultCarotPos ();
93+ caretPos = getDefaultCaretPos ();
9494 } else {
9595 // gets the appropriate caret position for where you click
9696 int textX = (int ) mouseX - (inputFieldBounds .xLimit () - textRenderer .getWidth (getValueText ()));
@@ -99,7 +99,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
9999 for (char ch : inputField .toCharArray ()) {
100100 pos ++;
101101 int charLength = textRenderer .getWidth (String .valueOf (ch ));
102- if (currentWidth + charLength / 2 > textX ) { // if more than half way past the characters select in front of that char
102+ if (currentWidth + charLength / 2 > textX ) { // if more than halfway past the characters select in front of that char
103103 caretPos = pos ;
104104 break ;
105105 } else if (pos == inputField .length () - 1 ) {
@@ -119,7 +119,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
119119 return false ;
120120 }
121121
122- protected int getDefaultCarotPos () {
122+ protected int getDefaultCaretPos () {
123123 return inputField .length ();
124124 }
125125
0 commit comments