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.
"
This commit is contained in:
Robert Osfield
2011-01-27 17:14:28 +00:00
parent 278203240b
commit 2a18c8b02a

View File

@@ -324,7 +324,7 @@ void Window::update() {
else if(_vAnchor == VA_BOTTOM) y = 0.0f;
if(_hAnchor == HA_LEFT) x = 0.0f;
else if(_hAnchor == HA_CENTER) x = osg::round(_wm->getWidth() / 2.0f);
else if(_hAnchor == HA_CENTER) x = osg::round((_wm->getWidth() - _width.current)/ 2.0f);
else if(_hAnchor == HA_RIGHT) x = _wm->getWidth() - _width.current + _visibleArea[2];
xy.set(x, y);