diff --git a/src/main/java/com/cleanroommc/modularui/drawable/text/TextRenderer.java b/src/main/java/com/cleanroommc/modularui/drawable/text/TextRenderer.java index dd17675c7..28b7a5a1e 100644 --- a/src/main/java/com/cleanroommc/modularui/drawable/text/TextRenderer.java +++ b/src/main/java/com/cleanroommc/modularui/drawable/text/TextRenderer.java @@ -232,7 +232,7 @@ protected int getStartY(float height) { protected int getStartY(float maxHeight, float height) { if (this.alignment.y > 0 && maxHeight > 0 && height != maxHeight) { - return (int) (this.y + (maxHeight * this.alignment.y) - height * this.alignment.y); + return this.y + Math.round(maxHeight * this.alignment.y) - Math.round(height * this.alignment.y); } return this.y; } @@ -243,7 +243,7 @@ protected int getStartX(float lineWidth) { protected int getStartX(float maxWidth, float lineWidth) { if (this.alignment.x > 0 && maxWidth > 0) { - return Math.max(this.x, (int) (this.x + (maxWidth * this.alignment.x) - lineWidth * this.alignment.x)); + return Math.max(this.x, this.x + Math.round(maxWidth * this.alignment.x) - Math.round(lineWidth * this.alignment.x)); } return this.x; }