|
From: <eli...@us...> - 2006-10-27 08:15:41
|
Revision: 2616
http://svn.sourceforge.net/java-game-lib/?rev=2616&view=rev
Author: elias_naur
Date: 2006-10-27 01:15:31 -0700 (Fri, 27 Oct 2006)
Log Message:
-----------
Mac OS X: Fixed cursor warping coordinates
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2006-10-27 06:27:58 UTC (rev 2615)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2006-10-27 08:15:31 UTC (rev 2616)
@@ -43,6 +43,7 @@
import java.awt.event.MouseWheelListener;
import java.awt.Component;
import java.awt.Rectangle;
+import java.awt.Point;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
@@ -84,8 +85,9 @@
void warpCursor() {
if (isGrabbed()) {
Rectangle bounds = getComponent().getBounds();
- int x = bounds.x + bounds.width/2;
- int y = bounds.y + bounds.height/2;
+ Point location_on_screen = getComponent().getLocationOnScreen();
+ int x = location_on_screen.x + bounds.width/2;
+ int y = location_on_screen.y + bounds.height/2;
nWarpCursor(x, y);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|