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:
kappa1 2010-03-27 16:04:30 +00:00
parent a4ed94bf4d
commit 08a2e8a010
1 changed files with 6 additions and 1 deletions

View File

@ -204,8 +204,13 @@ 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;
}
}
}