diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index 5cb69fd88..60b920a95 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -231,11 +231,18 @@ bool Text::computeBound() const for(unsigned int i=0;i<_autoTransformCache.size();++i) { - osg::Matrix& matrix = _autoTransformCache[i]._matrix; - _bbox.expandBy(osg::Vec3(_textBB.xMin(),_textBB.yMin(),_textBB.zMin())*matrix); - _bbox.expandBy(osg::Vec3(_textBB.xMax(),_textBB.yMin(),_textBB.zMin())*matrix); - _bbox.expandBy(osg::Vec3(_textBB.xMax(),_textBB.yMax(),_textBB.zMin())*matrix); - _bbox.expandBy(osg::Vec3(_textBB.xMin(),_textBB.yMax(),_textBB.zMin())*matrix); + if (_autoTransformCache[i]._traversalNumber<0 && (_characterSizeMode!=OBJECT_COORDS || _autoRotateToScreen)) + { + // _autoTransformCache is not valid so don't take it into accoumt when compute bounding volume. + } + else + { + osg::Matrix& matrix = _autoTransformCache[i]._matrix; + _bbox.expandBy(osg::Vec3(_textBB.xMin(),_textBB.yMin(),_textBB.zMin())*matrix); + _bbox.expandBy(osg::Vec3(_textBB.xMax(),_textBB.yMin(),_textBB.zMin())*matrix); + _bbox.expandBy(osg::Vec3(_textBB.xMax(),_textBB.yMax(),_textBB.zMin())*matrix); + _bbox.expandBy(osg::Vec3(_textBB.xMin(),_textBB.yMax(),_textBB.zMin())*matrix); + } } }