diff options
author | Sven Gothel <[email protected]> | 2014-05-27 20:20:40 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-05-27 20:20:40 +0200 |
commit | 8b255eb303bba045b4eb087da1d1cb33b2e89e96 (patch) | |
tree | 990497f96015eccc0edb5ad23eaf093e0a1b5e74 | |
parent | fcd59768d776e202d3b03b7a9fee2aac69b3b663 (diff) |
Bug 741 HiDPI: Add missing window -> pixel unit conversion in AWTNewtEventFactory (e.g. for NewtCanvasAWT)
-rw-r--r-- | make/scripts/tests.sh | 6 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 7dc6a2032..dbff7032f 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -208,7 +208,7 @@ function jrun() { #D_ARGS="-Dnewt.debug.Window -Djogl.debug.Animator -Dnewt.debug.Screen" #D_ARGS="-Dnativewindow.debug.JAWT -Dnewt.debug.Window" #D_ARGS="-Dnewt.debug.Window.KeyEvent" - #D_ARGS="-Dnewt.debug.Window.MouseEvent" + D_ARGS="-Dnewt.debug.Window.MouseEvent" #D_ARGS="-Dnewt.debug.Window.MouseEvent -Dnewt.debug.Window.KeyEvent" #D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug=all" #D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug.JAWT -Djogl.debug.Animator" @@ -547,7 +547,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01aNEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01bNEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01cNEWT $* -testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01dNEWT $* +#testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01dNEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02aNEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.mm.ManualScreenMode03aNEWT $* @@ -761,7 +761,7 @@ testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01dNEWT $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.ui.UINewtDemo01 $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo $* -#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo $* +testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $* 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 .. |