File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -484,6 +484,14 @@ void TextBase::computePositions()
484484
485485void TextBase::computePositionsImplementation ()
486486{
487+ _normal = osg::Vec3 (0 .0f ,0 .0f ,1 .0f );
488+
489+ if (_text.empty ())
490+ {
491+ _offset = Vec3 ();
492+ return ;
493+ }
494+
487495 switch (_alignment)
488496 {
489497 case LEFT_TOP: _offset.set (_textBB.xMin (),_textBB.yMax (),_textBB.zMin ()); break ;
@@ -506,8 +514,6 @@ void TextBase::computePositionsImplementation()
506514 case CENTER_BOTTOM_BASE_LINE: _offset.set ((_textBB.xMax ()+_textBB.xMin ())*0 .5f ,-_characterHeight*(1.0 + _lineSpacing)*(_lineCount-1 ),0 .0f ); break ;
507515 case RIGHT_BOTTOM_BASE_LINE: _offset.set (_textBB.xMax (),-_characterHeight*(1.0 + _lineSpacing)*(_lineCount-1 ),0 .0f ); break ;
508516 }
509-
510- _normal = osg::Vec3 (0 .0f ,0 .0f ,1 .0f );
511517}
512518
513519bool TextBase::computeMatrix (osg::Matrix& matrix, osg::State* state) const
You can’t perform that action at this time.
0 commit comments