Add parameterised mouse point rescaling helper for events

This commit is contained in:
Chicken-Bomes committed 2014-07-25 00:32:36 +10:00
1 parent 9411dd0808
commit 0ba1132ff6
1 file changed
+6 -2
+6 -2
View File
@@ -110,10 +110,14 @@ public class GuiDraw
return new Dimension(mc.displayWidth, mc.displayHeight);
}
public static Point getMousePosition() {
public static Point getMousePosition(int eventX, int eventY) {
Dimension size = displaySize();
Dimension res = displayRes();
return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1);
return new Point(eventX * size.width / res.width, size.height - eventY * size.height / res.height - 1);
}
public static Point getMousePosition() {
return getMousePosition(Mouse.getX(), Mouse.getY());
}
public static void changeTexture(String s) {