From d24c0b665d043f8f7b0f00658d9749dec3a3240f Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:42:15 +0300 Subject: [PATCH] WDynamicLabel: Rename alignment + getter/setter -> horizontalAlignment --- .../cottonmc/cotton/gui/widget/WDynamicLabel.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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 849b9c55..03264561 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 @@ -21,7 +21,7 @@ */ public class WDynamicLabel extends WWidget { protected Supplier text; - protected HorizontalAlignment alignment = HorizontalAlignment.LEFT; + protected HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT; protected VerticalAlignment verticalAlignment = VerticalAlignment.TOP; protected int color; protected int darkmodeColor; @@ -66,9 +66,9 @@ public void paint(DrawContext context, int x, int y, int mouseX, int mouseY) { String tr = text.get(); if (getDrawShadows()) { - ScreenDrawing.drawStringWithShadow(context, tr, alignment, x, y + yOffset, this.getWidth(), shouldRenderInDarkMode() ? darkmodeColor : color); + ScreenDrawing.drawStringWithShadow(context, tr, horizontalAlignment, x, y + yOffset, this.getWidth(), shouldRenderInDarkMode() ? darkmodeColor : color); } else { - ScreenDrawing.drawString(context, tr, alignment, x, y + yOffset, this.getWidth(), shouldRenderInDarkMode() ? darkmodeColor : color); + ScreenDrawing.drawString(context, tr, horizontalAlignment, x, y + yOffset, this.getWidth(), shouldRenderInDarkMode() ? darkmodeColor : color); } } @@ -153,10 +153,9 @@ public WDynamicLabel setText(Supplier text) { * Gets the horizontal text alignment of this label. * * @return the alignment - * @since 11.1.0 */ - public HorizontalAlignment getAlignment() { - return alignment; + public HorizontalAlignment getHorizontalAlignment() { + return horizontalAlignment; } /** @@ -165,8 +164,8 @@ public HorizontalAlignment getAlignment() { * @param align the new text alignment * @return this label */ - public WDynamicLabel setAlignment(HorizontalAlignment align) { - this.alignment = align; + public WDynamicLabel setHorizontalAlignment(HorizontalAlignment align) { + this.horizontalAlignment = align; return this; }