From: <ka...@us...> - 2010-03-27 16:04:36
|
Revision: 3297 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3297&view=rev Author: kappa1 Date: 2010-03-27 16:04:30 +0000 (Sat, 27 Mar 2010) Log Message: ----------- 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. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java Modified: trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java 2010-03-27 01:12:05 UTC (rev 3296) +++ trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java 2010-03-27 16:04:30 UTC (rev 3297) @@ -204,8 +204,13 @@ 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; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |