Further improvement to mouse ungrab position behaviour. Mouse no longer limited to just ungrabbing at the position it was grabbed, now you can can call setCursorPosition(x,y) while mouse is grabbed and ungrab the mouse at any position you like.
This commit is contained in:
parent
a4ed94bf4d
commit
08a2e8a010
|
@ -204,9 +204,14 @@ public class Mouse {
|
|||
throw new IllegalStateException("Mouse is not created");
|
||||
x = event_x = new_x;
|
||||
y = event_y = new_y;
|
||||
if (!isGrabbed() && (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0)
|
||||
if (!isGrabbed() && (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0) {
|
||||
implementation.setCursorPosition(x, y);
|
||||
}
|
||||
else {
|
||||
grab_x = new_x;
|
||||
grab_y = new_y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue