fix font center issue on high resolution
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user