aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-05-27 20:20:40 +0200
committerSven Gothel <[email protected]>2014-05-27 20:20:40 +0200
commit8b255eb303bba045b4eb087da1d1cb33b2e89e96 (patch)
tree990497f96015eccc0edb5ad23eaf093e0a1b5e74 /src
parentfcd59768d776e202d3b03b7a9fee2aac69b3b663 (diff)
Bug 741 HiDPI: Add missing window -> pixel unit conversion in AWTNewtEventFactory (e.g. for NewtCanvasAWT)
Diffstat (limited to 'src')
-rw-r--r--src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
index 0ee3cc0cd..2d2f628ae 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
@@ -414,7 +414,7 @@ public class AWTNewtEventFactory {
}
public static int newtKeyCode2AWTKeyCode(final short newtKeyCode) {
- final int defAwtKeyCode = 0xFFFF & (int)newtKeyCode;
+ final int defAwtKeyCode = 0xFFFF & newtKeyCode;
switch (newtKeyCode) {
case com.jogamp.newt.event.KeyEvent.VK_HOME : return java.awt.event.KeyEvent.VK_HOME;
case com.jogamp.newt.event.KeyEvent.VK_END : return java.awt.event.KeyEvent.VK_END;
@@ -634,9 +634,10 @@ public class AWTNewtEventFactory {
mods |= com.jogamp.newt.event.InputEvent.INVISIBLE_MASK;
}
}
+ final int[] pixelPos = newtSource.convertToPixelUnits(new int[] { event.getX(), event.getY() });
return new com.jogamp.newt.event.MouseEvent(
newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
- mods, event.getX(), event.getY(), (short)event.getClickCount(),
+ mods, pixelPos[0], pixelPos[1], (short)event.getClickCount(),
newtButton, MouseEvent.getRotationXYZ(rotation, mods), 1f);
}
return null; // no mapping ..