Skip to content

Commit e58fcda

Browse files
AzureAaronlineargraph
authored andcommitted
Fix mouse position calculations for < 1.21.11
1 parent db7f11a commit e58fcda

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

modern/templates/java/io/github/notenoughupdates/moulconfig/platform/MoulConfigPlatform.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ public Pair<Double, Double> getMousePositionHF() {
179179
var mouse = mc.mouseHandler;
180180
var window = mc.getWindow();
181181
#if MC < 12111
182-
var x = (mouse.xpos() * (double) window.getGuiScaledWidth() / window.getWidth());
183-
var y = (mouse.ypos() * (double) window.getGuiScaledHeight() / window.getHeight());
182+
var x = (mouse.xpos() * (double) window.getGuiScaledWidth() / window.getScreenWidth());
183+
var y = (mouse.ypos() * (double) window.getGuiScaledHeight() / window.getScreenHeight());
184184
#else
185185
double x = mouse.getScaledXPos(window);
186186
double y = mouse.getScaledYPos(window);

0 commit comments

Comments
 (0)