fixed relative coordinate bug
This commit is contained in:
parent
368207e9e2
commit
438e790987
|
@ -351,9 +351,9 @@ public class Mouse {
|
||||||
// set absolute position
|
// set absolute position
|
||||||
x += poll_dx;
|
x += poll_dx;
|
||||||
y += poll_dy;
|
y += poll_dy;
|
||||||
dx += poll_dx;
|
dx = poll_dx;
|
||||||
dy += poll_dy;
|
dy = poll_dy;
|
||||||
dwheel += poll_dwheel;
|
dwheel = poll_dwheel;
|
||||||
|
|
||||||
// if window has been created, clamp to edges
|
// if window has been created, clamp to edges
|
||||||
if(Window.isCreated()) {
|
if(Window.isCreated()) {
|
||||||
|
@ -509,27 +509,21 @@ public class Mouse {
|
||||||
* @return Movement on the x axis since last time getDX() was called
|
* @return Movement on the x axis since last time getDX() was called
|
||||||
*/
|
*/
|
||||||
public static int getDX() {
|
public static int getDX() {
|
||||||
int result = dx;
|
return dx;
|
||||||
dx = 0;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Movement on the y axis since last time getDY() was called
|
* @return Movement on the y axis since last time getDY() was called
|
||||||
*/
|
*/
|
||||||
public static int getDY() {
|
public static int getDY() {
|
||||||
int result = dy;
|
return dy;
|
||||||
dy = 0;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Movement of the wheel since last time getDWheel() was called
|
* @return Movement of the wheel since last time getDWheel() was called
|
||||||
*/
|
*/
|
||||||
public static int getDWheel() {
|
public static int getDWheel() {
|
||||||
int result = dwheel;
|
return dwheel;
|
||||||
dwheel = 0;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue