diff options
author | Sven Gothel <[email protected]> | 2014-05-26 19:04:41 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-05-26 19:04:41 +0200 |
commit | 759d90674d977bae24ba58684fad3830f7f0d40f (patch) | |
tree | 16c402b0cc667e7d4d7899f9be92756465a372db /src/nativewindow/classes/jogamp | |
parent | 56d60b36798fa8dae48bf2aa5e2de6f3178ab0d1 (diff) |
Bug 1012: Fix erroneous handling of multiple monitor coordinates on OSX with NEWT
To properly convert Top-Left (TL) from/to Bottom-Left (BL) coordinates
we need to utilize the given CGDisplay viewport (TL)
and NSScreen (BL) to perform the y-flip.
This is especially true for the case of having multiple monitors
covering different viewports (mixed resolution).
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java index 31b06d360..12e574ced 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java @@ -91,31 +91,13 @@ public class OSXUtil implements ToolkitProperties { } /** - * In case the <code>windowOrView</code> is top-level, - * you shall set <code>topLevel</code> to true where - * insets gets into account to compute the client position as follows: - * <pre> - if(topLevel) { - // top-level position -> client window position - final Insets insets = GetInsets(windowOrView); - los.setX(los.getX() + insets.getLeftWidth()); - los.setY(los.getY() + insets.getTopHeight()); - } - * </pre> * @param windowOrView - * @param topLevel * @param src_x * @param src_y - * @return the client position + * @return top-left client-area position in window units */ - public static Point GetLocationOnScreen(long windowOrView, boolean topLevel, int src_x, int src_y) { - final Point los = (Point) GetLocationOnScreen0(windowOrView, src_x, src_y); - if(topLevel) { - // top-level position -> client window position - final Insets insets = GetInsets(windowOrView); - los.set(los.getX() + insets.getLeftWidth(), los.getY() + insets.getTopHeight()); - } - return los; + public static Point GetLocationOnScreen(long windowOrView, int src_x, int src_y) { + return (Point) GetLocationOnScreen0(windowOrView, src_x, src_y); } public static Insets GetInsets(long windowOrView) { |