From 05b72e9b4c131bddac7055e78eb4951ef58e8666 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 14 Jun 2013 09:43:04 +0000 Subject: [PATCH] Fixed TextBase::computeBound() so it take into account all corners of the text box thus ensuring proper handling of rotated text --- src/osgText/TextBase.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osgText/TextBase.cpp b/src/osgText/TextBase.cpp index c0ac6df89..16382067a 100644 --- a/src/osgText/TextBase.cpp +++ b/src/osgText/TextBase.cpp @@ -306,6 +306,12 @@ osg::BoundingBox TextBase::computeBound() const matrix.postMultRotate(_rotation); matrix.postMultTranslate(_position); 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.xMin(),_textBB.yMax(),_textBB.zMin())*matrix); + bbox.expandBy(osg::Vec3(_textBB.xMax(),_textBB.yMax(),_textBB.zMin())*matrix); + bbox.expandBy(osg::Vec3(_textBB.xMin(),_textBB.yMin(),_textBB.zMax())*matrix); + bbox.expandBy(osg::Vec3(_textBB.xMax(),_textBB.yMin(),_textBB.zMax())*matrix); + bbox.expandBy(osg::Vec3(_textBB.xMin(),_textBB.yMax(),_textBB.zMax())*matrix); bbox.expandBy(osg::Vec3(_textBB.xMax(),_textBB.yMax(),_textBB.zMax())*matrix); } }