aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuuz <6596629+Juuxel@users.noreply.github.com>2021-12-06 15:06:47 +0200
committerJuuz <6596629+Juuxel@users.noreply.github.com>2021-12-06 15:06:47 +0200
commit6557ffcbfc95841d5dccdadaf97e5d2277f84f8d (patch)
treee1c5fcdba60982ca3503117b0af1424eaaa7ae8a /src
parent02c8f746e48b1e130c9d777178a8a236921c5099 (diff)
downloadLibGui-6557ffcbfc95841d5dccdadaf97e5d2277f84f8d.tar.gz
LibGui-6557ffcbfc95841d5dccdadaf97e5d2277f84f8d.tar.bz2
LibGui-6557ffcbfc95841d5dccdadaf97e5d2277f84f8d.zip
Remove deprecations
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java
index 5d2fc9f..fd044fc 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java
@@ -34,12 +34,6 @@ import java.util.function.Consumer;
import java.util.function.Predicate;
public class WTextField extends WWidget {
- /**
- * Use TEXT_PADDING_X instead.
- */
- @Deprecated(forRemoval = true)
- public static final int OFFSET_X_TEXT = 4;
-
public static final int TEXT_PADDING_X = 4;
public static final int TEXT_PADDING_Y = 6;
public static final int CURSOR_PADDING_Y = 4;
@@ -496,41 +490,4 @@ public class WTextField extends WWidget {
builder.put(NarrationPart.HINT, new TranslatableText(NarrationMessages.TEXT_FIELD_SUGGESTION_KEY, suggestion));
}
}
-
- /**
- * From an X offset past the left edge of a TextRenderer.draw, finds out what the closest caret position (division
- * between letters) is.
- */
- @Environment(EnvType.CLIENT)
- @Deprecated(forRemoval = true)
- @ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
- public static int getCaretPos(String s, int x) {
- if (x <= 0) return 0;
-
- TextRenderer font = MinecraftClient.getInstance().textRenderer;
- int lastAdvance = 0;
- for (int i = 0; i < s.length() - 1; i++) {
- int advance = font.getWidth(s.substring(0, i + 1));
- int charAdvance = advance - lastAdvance;
- if (x < advance + (charAdvance / 2)) return i + 1;
-
- lastAdvance = advance;
- }
-
- return s.length();
- }
-
- /**
- * From a caret position, finds out what the x-offset to draw the caret is.
- */
- @Environment(EnvType.CLIENT)
- @Deprecated(forRemoval = true)
- @ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
- public static int getCaretOffset(String s, int pos) {
- if (pos==0) return 0;//-1;
-
- TextRenderer font = MinecraftClient.getInstance().textRenderer;
- int ofs = font.getWidth(s.substring(0, pos))+1;
- return ofs; //(font.isRightToLeft()) ? -ofs : ofs;
- }
}