aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-04-13 21:14:29 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-04-13 21:14:29 +0300
commit3517075c7f635724f7c414dc1f333ad845c11ab8 (patch)
treeda4ac6f26ce6912cd1d7567ba8a487b198a170d5 /src/main
parent197ef4f75563e3d33d4079276a2a762c530767a6 (diff)
downloadLibGui-3517075c7f635724f7c414dc1f333ad845c11ab8.tar.gz
LibGui-3517075c7f635724f7c414dc1f333ad845c11ab8.tar.bz2
LibGui-3517075c7f635724f7c414dc1f333ad845c11ab8.zip
Fix #45
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java3
1 files changed, 2 insertions, 1 deletions
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 ebf74b2..9761a6d 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
@@ -72,7 +72,7 @@ public class WText extends WWidget {
@Environment(EnvType.CLIENT)
@Override
public void paintBackground(int x, int y, int mouseX, int mouseY) {
- if (wrappingScheduled) {
+ if (wrappedLines == null || wrappingScheduled) {
wrapLines();
wrappingScheduled = false;
}
@@ -110,6 +110,7 @@ public class WText extends WWidget {
}
public WText setText(Text text) {
+ Objects.requireNonNull(text, "text is null");
this.text = text;
wrappingScheduled = true;