From cea29a50930ee20c5bbfdcc93ee039fc28097a01 Mon Sep 17 00:00:00 2001 From: Carsten Weisse Date: Sat, 12 May 2007 15:15:32 +0000 Subject: bugfix: center the mouse correct, now really ;-) --- src/jake2/sys/JOGLKBD.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/jake2/sys/JOGLKBD.java b/src/jake2/sys/JOGLKBD.java index e5c86a3..8fda765 100644 --- a/src/jake2/sys/JOGLKBD.java +++ b/src/jake2/sys/JOGLKBD.java @@ -56,8 +56,6 @@ final public class JOGLKBD extends KBD if (IN.mouse_active) { mx = (((MouseEvent)event.ev).getX() - win_w2) * 2; my = (((MouseEvent)event.ev).getY() - win_h2) * 2; - System.out - .println(mx + " " + my); } else { mx = 0; my = 0; @@ -90,8 +88,8 @@ final public class JOGLKBD extends KBD Component c = ((ComponentEvent)event.ev).getComponent(); win_x = 0; win_y = 0; - win_w2 = (c.getWidth() + 1) / 2; - win_h2 = (c.getHeight() + 1) / 2; + win_w2 = c.getWidth() / 2; + win_h2 = c.getHeight() / 2; int left = 0; int top = 0; while (c != null) { if (c instanceof Container) { @@ -104,7 +102,7 @@ final public class JOGLKBD extends KBD c = c.getParent(); } win_x += left; win_y += top; - win_w2 -= (left + 1) / 2; win_h2 -= (top + 1) / 2; + win_w2 -= left / 2; win_h2 -= top / 2; break; } } -- cgit v1.2.3