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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user