From e9ce2246c947cc357fef993003008fe4c6a0495f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 3 Oct 2013 15:35:09 +0200 Subject: Bug 816 (OSX CALayer pos): Add detailed description (pseudo code) to JAWTUtil.JAWT_OSX_CALAYER_QUIRK_LAYOUT --- .../classes/jogamp/nativewindow/jawt/JAWTUtil.java | 20 +++++++++++++++++++- .../nativewindow/jawt/macosx/MacOSXJAWTWindow.java | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src/nativewindow/classes') diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java index b20007d53..844b17469 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java @@ -152,7 +152,7 @@ public class JAWTUtil { * CALayer position needs to be derived from AWT position * in relation to super CALayer. *

- * AWT's super-calayer, i.e. the AWT's own component CALayer, + * AWT's super-calayer, i.e. the AWT top-container's CALayer, * does not layout our root-calayer in respect to this component's * position and size, at least when resizing programmatically. *

@@ -164,6 +164,24 @@ public class JAWTUtil { * The super-calayer bounds exclude the frame's heavyweight border/insets. *

*

+ * The super-calayer lies within the AWT top-container client space (content). + *

+ *

+ * Component's location in super-calayer: + *

+      p0 = c.locationOnScreen();
+      p0 -= c.getOutterComp.getPos();
+      p0 -= c.getOutterComp.getInsets();
+   * 
+ * Where 'locationOnScreen()' is: + *
+     p0 = 0/0;
+     while( null != c ) {
+       p0 += c.getPos();
+     }
+   * 
+ *

+ *

* This flags also sets {@link #JAWT_OSX_CALAYER_QUIRK_SIZE}, * i.e. they are related. *

diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java index 833e6cd24..2eff1bc09 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java @@ -110,7 +110,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { // AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets. // Determine p0: components location on screen w/o insets. // CALayer position will be determined in native code. - // See: {@link JAWTWindow#JAWT_OSX_CALAYER_QUIRK_LAYOUT} + // See detailed description in {@link JAWTUtil#JAWT_OSX_CALAYER_QUIRK_LAYOUT} final Point p0 = new Point(); final Component outterComp = getLocationOnScreenNonBlocking(p0, component); final java.awt.Insets outterInsets = AWTMisc.getInsets(outterComp, true); @@ -141,7 +141,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { // AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets. // Determine p0: components location on screen w/o insets. // CALayer position will be determined in native code. - // See: {@link JAWTWindow#JAWT_OSX_CALAYER_QUIRK_LAYOUT} + // See detailed description in {@link JAWTUtil#JAWT_OSX_CALAYER_QUIRK_LAYOUT} final Point p0 = new Point(); final Component outterComp = getLocationOnScreenNonBlocking(p0, component); final java.awt.Insets outterInsets = AWTMisc.getInsets(outterComp, true); -- cgit v1.2.3