aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-05-28 00:50:59 +0200
committerSven Gothel <[email protected]>2014-05-28 00:50:59 +0200
commitf9ce025372b0b1cb9b8db78a0d4294861172bc1e (patch)
treedac7053e0406d7b46d0b83c48acc1924c60e3068
parentc142f237d171e1cd16918a2f897447444a709b56 (diff)
Bug 741 HiDPI: Fix missing window -> pixel unit conversion in AWTNewtEventFactory of commit 8b255eb303bba045b4eb087da1d1cb33b2e89e96
-rw-r--r--src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
index 2d2f628ae..709143b82 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
@@ -626,6 +626,7 @@ public class AWTNewtEventFactory {
final short newtButton = awtButton2Newt(event.getButton());
int mods = awtModifiers2Newt(event.getModifiers(), event.getModifiersEx());
mods |= com.jogamp.newt.event.InputEvent.getButtonMask(newtButton); // always include NEWT BUTTON_MASK
+ final int[] pixelPos;
if(null!=newtSource) {
if(newtSource.isPointerConfined()) {
mods |= com.jogamp.newt.event.InputEvent.CONFINED_MASK;
@@ -633,8 +634,10 @@ public class AWTNewtEventFactory {
if(!newtSource.isPointerVisible()) {
mods |= com.jogamp.newt.event.InputEvent.INVISIBLE_MASK;
}
+ pixelPos = newtSource.convertToPixelUnits(new int[] { event.getX(), event.getY() });
+ } else {
+ pixelPos = new int[] { event.getX(), event.getY() };
}
- 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, pixelPos[0], pixelPos[1], (short)event.getClickCount(),