diff options
| author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-07-05 23:39:40 +0900 |
|---|---|---|
| committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-07-05 23:39:40 +0900 |
| commit | d3f5df5e56d27394b6e1e246e4114a8f40236b60 (patch) | |
| tree | f5952503eb3bc095914f4f77b81531ab2c050d90 /src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java | |
| parent | 6cafd268d486a930c7e8bec229c30eb6a50fe436 (diff) | |
| parent | 54d915940ee0856bc7cac4a37687cb7783e07cee (diff) | |
| download | OneConfig-d3f5df5e56d27394b6e1e246e4114a8f40236b60.tar.gz OneConfig-d3f5df5e56d27394b6e1e246e4114a8f40236b60.tar.bz2 OneConfig-d3f5df5e56d27394b6e1e246e4114a8f40236b60.zip | |
Merge branch 'nextdaydelivery-self'
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java')
| -rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java index a48d369..6582eaa 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java @@ -96,7 +96,7 @@ public final class InputUtils { * @return the current mouse X position */ public static int mouseX() { - if (OneConfigGui.INSTANCE == null) return Platform.getMousePlatform().getMouseX(); + if (OneConfigGui.INSTANCE == null) return (int) Platform.getMousePlatform().getMouseX(); //todo stop casting and actually use doubles return (int) (Platform.getMousePlatform().getMouseX() / OneConfigGui.INSTANCE.getScaleFactor()); } @@ -110,7 +110,7 @@ public final class InputUtils { * @return the current mouse Y position */ public static int mouseY() { - if (OneConfigGui.INSTANCE == null) return UResolution.getWindowHeight() - Math.abs(Platform.getMousePlatform().getMouseY()); + if (OneConfigGui.INSTANCE == null) return (int) (UResolution.getWindowHeight() - Math.abs(Platform.getMousePlatform().getMouseY())); return (int) ((UResolution.getWindowHeight() - Math.abs(Platform.getMousePlatform().getMouseY())) / OneConfigGui.INSTANCE.getScaleFactor()); } |
