diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WDynamicLabel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WDynamicLabel.java index bb28551c..a5f00906 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WDynamicLabel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WDynamicLabel.java @@ -5,7 +5,9 @@ import net.minecraft.client.gui.DrawContext; import io.github.cottonmc.cotton.gui.client.ScreenDrawing; +import io.github.cottonmc.cotton.gui.widget.data.VerticalAlignment; import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment; +import io.github.cottonmc.cotton.gui.impl.client.TextAlignment; import java.util.function.Supplier; @@ -18,7 +20,7 @@ */ public class WDynamicLabel extends WWidget { protected Supplier text; - protected HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT; + protected HorizontalAlignment alignment = HorizontalAlignment.LEFT; protected VerticalAlignment verticalAlignment = VerticalAlignment.TOP; protected int color; protected int darkmodeColor; @@ -60,7 +62,7 @@ public void paint(DrawContext context, int x, int y, int mouseX, int mouseY) { int yOffset = TextAlignment.getTextOffsetY(verticalAlignment, height, 1); String tr = text.get(); - ScreenDrawing.drawString(context, tr, horizontalAlignment, x, y + yOffset, this.getWidth(), shouldRenderInDarkMode() ? darkmodeColor : color); + ScreenDrawing.drawString(context, tr, alignment, x, y + yOffset, this.getWidth(), shouldRenderInDarkMode() ? darkmodeColor : color); } @Override @@ -124,8 +126,8 @@ public WDynamicLabel setText(Supplier text) { * @return the alignment * @since 11.1.0 */ - public VerticalAlignment getVerticalAlignment() { - return verticalAlignment; + public HorizontalAlignment getAlignment() { + return alignment; } /**