From f1ead2e06a7705f7735b50cab8b5b3f679148492 Mon Sep 17 00:00:00 2001 From: lcy0x1 Date: Thu, 5 May 2022 13:12:49 -0700 Subject: [PATCH] fix Mac Mouse Error (#182) --- .../slimeknights/mantle/client/screen/book/BookScreen.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/slimeknights/mantle/client/screen/book/BookScreen.java b/src/main/java/slimeknights/mantle/client/screen/book/BookScreen.java index 77e8048fa..911e7b7ea 100644 --- a/src/main/java/slimeknights/mantle/client/screen/book/BookScreen.java +++ b/src/main/java/slimeknights/mantle/client/screen/book/BookScreen.java @@ -535,12 +535,12 @@ protected float topOffset() { protected int getMouseX(boolean rightSide) { assert this.minecraft != null; - return (int) ((Minecraft.getInstance().mouseHandler.xpos() * this.width / this.minecraft.getWindow().getWidth() - this.leftOffset(rightSide)) / PAGE_SCALE); + return (int) ((Minecraft.getInstance().mouseHandler.xpos() * this.width / this.minecraft.getWindow().getScreenWidth() - this.leftOffset(rightSide)) / PAGE_SCALE); } protected int getMouseY() { assert this.minecraft != null; - return (int) ((Minecraft.getInstance().mouseHandler.ypos() * this.height / this.minecraft.getWindow().getHeight() - 1 - this.topOffset()) / PAGE_SCALE); + return (int) ((Minecraft.getInstance().mouseHandler.ypos() * this.height / this.minecraft.getWindow().getScreenHeight() - 1 - this.topOffset()) / PAGE_SCALE); } public int openPage(int page) {