Re: Mac Canvas3D location bug
Posted by
jimthev on
Sep 18, 2013; 10:51pm
URL: https://forum.jogamp.org/Mac-Canvas3D-location-bug-tp4030052p4030065.html
After finally being able to compile jogl on OSX 10.6 here is where I'm at:
The location that is being drawn on the screen is being set in:
https://github.com/sgothel/jogl/blob/master/src/nativewindow/native/macosx/OSXmisc.min the static void FixCALayerLayout0 function.
There the coordinate system is from the lower left of the applet area so:
lRect.origin.x = 0;
lRect.origin.y = 0;
lRect.size.width = width;
lRect.size.height = height;
[rootLayer setFrame: lRect];
Sets the frame to the bottom left of the entire applet area and shrinks it so that it is the width of the Canvas3D. If I override the origin x and y values then the frame moves as you'd think with 0,0 being lower left of the applet area
I'm going to try to trace it backwards to see what values should be set where and maybe other values need to be passed or calculated, but if somebody knows what needs to be done and can jump to the answer, that'd be great.
Another thing to note:
When initialized,
CGRect lRect = [rootLayer frame];
is the entire size of the applet area with x,y = 0;