Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusElg committed Aug 4, 2024
1 parent a598805 commit 0a36a59
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -18,7 +20,7 @@
*/
public class WDynamicLabel extends WWidget {
protected Supplier<String> text;
protected HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT;
protected HorizontalAlignment alignment = HorizontalAlignment.LEFT;
protected VerticalAlignment verticalAlignment = VerticalAlignment.TOP;
protected int color;
protected int darkmodeColor;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -124,8 +126,8 @@ public WDynamicLabel setText(Supplier<String> text) {
* @return the alignment
* @since 11.1.0
*/
public VerticalAlignment getVerticalAlignment() {
return verticalAlignment;
public HorizontalAlignment getAlignment() {
return alignment;
}

/**
Expand Down

0 comments on commit 0a36a59

Please sign in to comment.