From cad1d8162bb4bc900acece270abe46d80c749d87 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 25 Mar 2003 15:45:08 +0000 Subject: [PATCH] Fixed axis alignment bug in text, which occured what text was placed on the XZ or YZ planes. --- src/osgText/Text.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index e65cc3616..349c419e1 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -419,6 +419,16 @@ void Text::computePositions() case BASE_LINE: _offset.set(0.0f,0.0f,0.0f); break; } + // adjust offset for axis alignment + switch(_axisAlignment) + { + case XZ_PLANE: _offset.set(_offset.x(),-_offset.z(),_offset.y()); break; + case YZ_PLANE: _offset.set(_offset.z(),_offset.x(),_offset.y()); break; + case XY_PLANE: break; // nop - already on XY plane. + case SCREEN: break; // nop - need to account for rotation in draw as it depends on ModelView _matrix. + } + + _matrix.makeTranslate(_position-_offset); switch(_axisAlignment)