From cc0e892fcdb8d6e536801717cae60c2fe5b1ccd5 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Sat, 9 May 2020 14:30:34 +0300 Subject: Simplify getTextAt --- src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java | 2 +- src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java index d6d02d3..67bd55a 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java @@ -103,7 +103,7 @@ public class WLabel extends WWidget { @Nullable public Text getTextAt(int x, int y) { if (isWithinBounds(x, y)) { - return MinecraftClient.getInstance().textRenderer.getTextHandler().trimToWidth(text, x); + return MinecraftClient.getInstance().textRenderer.trimToWidth(text, x); } return null; } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java index ccc3e83..2d3a5ec 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java @@ -65,7 +65,7 @@ public class WText extends WWidget { if (lineIndex >= 0 && lineIndex < wrappedLines.size()) { Text line = wrappedLines.get(lineIndex); - return font.getTextHandler().trimToWidth(line, x); + return font.trimToWidth(line, x); } return null; -- cgit