From f9ce025372b0b1cb9b8db78a0d4294861172bc1e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 28 May 2014 00:50:59 +0200 Subject: Bug 741 HiDPI: Fix missing window -> pixel unit conversion in AWTNewtEventFactory of commit 8b255eb303bba045b4eb087da1d1cb33b2e89e96 --- src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(), -- cgit v1.2.3