Login  Register

Re: Mac Canvas3D location bug

Posted by jimthev on Sep 17, 2013; 4:26pm
URL: https://forum.jogamp.org/Mac-Canvas3D-location-bug-tp4030052p4030060.html

hharrison wrote
Please confirm that the values
coming out look correct for you, if they do, then either Java3d is somehow passing it to jogl incorrectly, or jogl is doing something odd.
The debug values of "Canvas Pos =" are correct.  They are the correct screen coordinates from the upper left of the screen where the Canvas3D should be located but isn't.

Upon further research, when you set the Canvas3D bounds to x,y,w,h in an applet with a null layout manager.
x is ignored, the x value used is always the left side of the applet.
y is ignored
w is used and is correct
h is correctly used as the height but it is also used as the y coordinate but the zero is on the bottom rather than the top and seems to be shifted down by 22 pixels on a 1280 x 800 display.

So the actual bounds in screen coordinates turns out to be something like: (applet bounds.x, 800 - h + 22, w, h) [EDIT: the coordinate system is from the lower left of the applet area.  My area extended about 22 pixels below the bottom of the screen during testing]