Hi Eric and Jeremy, Thanks for the review Jeremy. Eric I've now merged your fix into svn/trunk.
Cheers, Robert. On Thu, Jan 27, 2011 at 11:54 AM, Jeremy Moles <[email protected]> wrote: > On Mon, 2011-01-24 at 10:30 +0000, Robert Osfield wrote: >> Hi Jeremy, >> >> Could you please have a look at Eric's suggest change to Window.cpp? >> I've done a code review but it isn't clear to me what the relationship >> of the _wm and _width are intended to be. I've attached Eric's >> version Window.cpp. > > This patch is the proper behavior. Sorry it took me so long to respond, > I've been so incredibly busy this week I didn't have a chance until now. > >> Thanks, >> Robert. >> >> >> Original submissions post from Eric Buehler: >> >> I believe that the osgWidget::Window::HA_CENTER alignment should be >> center aligned rather than by the origin, as the >> osgWidget::Window::VA_TOP causes. >> >> The current setAnchorHorizontal() command doesn't center the center of >> the object, it just center's the object's origin. The following >> change to osgWidget::Window::update() will correct that behavior so >> that it is consistent with setAnchorVertical() behavior. >> >> Original trunk/src/osgWidget/Window.cpp v:10624: >> >> >> Code: >> 309 void Window::update() { >> ... >> 320 // We only honor ANCHOR requests on topmost Windows, not embedded >> ones. >> 321 if((_vAnchor != VA_NONE || _hAnchor != HA_NONE) && !_parent && _wm) { >> 322 if(_vAnchor == VA_TOP) y = _wm->getHeight() - _height.current; >> 323 else if(_vAnchor == VA_CENTER) y = >> osg::round(_wm->getHeight() / 2.0f); >> 324 else if(_vAnchor == VA_BOTTOM) y = 0.0f; >> 325 >> 326 if(_hAnchor == HA_LEFT) x = 0.0f; >> 327 else if(_hAnchor == HA_CENTER) x = osg::round(_wm->getWidth() / >> 2.0f); >> 328 else if(_hAnchor == HA_RIGHT) x = _wm->getWidth() - >> _width.current + _visibleArea[2]; >> 329 >> 330 xy.set(x, y); >> >> >> >> New >> >> Code: >> 327 else if(_hAnchor == HA_CENTER) x = >> osg::round((_wm->getWidth() - _width.current) / 2.0f); >> >> >> ---------- Forwarded message ---------- >> From: Eric Buehler <[email protected]> >> Date: Fri, Jan 21, 2011 at 5:35 PM >> Subject: Re: [osg-submissions] Fix for setAnchorHorizontal >> To: [email protected] >> >> >> Sorry. Here is the full file. >> >> from in src/osgWidget >> >> Thanks, >> Eric >> >> ------------------ >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=35873#35873 >> >> >> >> >> Attachments: >> http://forum.openscenegraph.org//files/window_153.cpp >> >> >> _______________________________________________ >> osg-submissions mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
