Permalink
Browse files

Fixed TextBase::computeBound() so it take into account all corners of…

… the text box thus ensuring proper handling of rotated text
  • Loading branch information...
1 parent bfdcb94 commit 1813a0f9a9d89b08221e13eca1f98f9988a5d1ee @osg-training-guest osg-training-guest committed Jun 14, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/osgText/TextBase.cpp
View
@@ -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);
}
}

0 comments on commit 1813a0f

Please sign in to comment.