Skip to content

Commit

Permalink
fix Mac Mouse Error (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcy0x1 committed May 5, 2022
1 parent 4d4973f commit f1ead2e
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -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) {
Expand Down

0 comments on commit f1ead2e

Please sign in to comment.