diff options
author | Sven Gothel <[email protected]> | 2013-10-17 19:37:31 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-10-17 19:37:31 +0200 |
commit | 0eceb7df4b04a183a738474c0d7f4be41b6bcc0c (patch) | |
tree | cef34bdc706dc289dcdf8cc2cb60b9db6bd13b43 /src | |
parent | d9fba0ea89ae71ce29fb528593fee24707b896ad (diff) |
WindowImpl.doPointerEvent(..) Simplify pointer name->ID mapping, fix DEBUG.
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index dcb811b97..624ac4df4 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -2428,18 +2428,20 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer for(int i=0; i<pCount; i++) { if( !normalPNames ) { // hash map int name -> short idx - final Integer pNameI0 = new Integer(pNames[i]); - final Integer pNameI1 = pName2pID.getOrAdd(pNameI0); + final int sz0 = pName2pID.size(); + final Integer pNameI1 = pName2pID.getOrAdd(Integer.valueOf(pNames[i])); final short pID = (short)pName2pID.indexOf(pNameI1); pIDs[i] = pID; if(DEBUG_MOUSE_EVENT) { - final boolean reuse = pNameI0 == pNameI1; - System.err.println("PointerName2ID[sz "+pName2pID.size()+"]: "+(reuse?"Reused":"Added")+" "+pNameI0+" : "+pID); + final int sz1 = pName2pID.size(); + if( sz0 != sz1 ) { + System.err.println("PointerName2ID[sz "+sz1+"]: Map "+pNameI1+" == "+pID); + } } if( MouseEvent.EVENT_MOUSE_RELEASED == eventType ) { pName2pID.remove(pNameI1); if(DEBUG_MOUSE_EVENT) { - System.err.println("PointerName2ID[sz "+pName2pID.size()+"]: Removed "+pNameI1+" : "+pID); + System.err.println("PointerName2ID[sz "+pName2pID.size()+"]: Unmap "+pNameI1+" == "+pID); } } } else { |