Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/HEAD' into 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed May 5, 2022
2 parents 797aae8 + f1ead2e commit 2c84f6b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
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 2c84f6b

Please sign in to comment.