fix font center issue on high resolution

This commit is contained in:
LabyStudio
2022-02-13 03:05:48 +01:00
parent 7858e98ffa
commit 9078d34ab0
2 changed files with 2 additions and 2 deletions
@@ -16,7 +16,7 @@ window.GuiButton = class extends Gui {
render(stack, mouseX, mouseY, partialTicks) {
let mouseOver = this.isMouseOver(mouseX, mouseY);
this.drawSprite(stack, GuiButton.textureGui, 0, 66 + (mouseOver ? 20 : 0), 200, 20, this.x, this.y, this.width, this.height);
this.drawCenteredString(stack, this.string, this.x + this.width / 2, this.y + this.height / 2 - 5);
this.drawCenteredString(stack, this.string, this.x + this.width / 2, this.y + this.height / 2 - 4);
}
onPress() {
@@ -83,7 +83,7 @@ window.FontRenderer = class {
this.texture,
textureOffsetX, textureOffsetY,
FontRenderer.FIELD_SIZE, FontRenderer.FIELD_SIZE,
x, y,
Math.floor(x), Math.floor(y),
FontRenderer.FIELD_SIZE, FontRenderer.FIELD_SIZE
);