Skip to content
Permalink
Browse files

Merged TextBase fixed from OpenSceneGraph-3.6 commit 149c04b

  • Loading branch information...
robertosfield committed Jul 31, 2019
1 parent 2b5e659 commit fd8019c88630c659b36cfd67cbf38b3f9cf7cede
Showing with 5 additions and 6 deletions.
  1. +0 −1 include/osgText/Text
  2. +1 −0 include/osgText/TextBase
  3. +4 −5 src/osgText/Text.cpp
@@ -265,7 +265,6 @@ protected:
virtual osg::StateSet* createStateSet();

Font* getActiveFont();
const Font* getActiveFont() const;

String::iterator computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last);

@@ -312,6 +312,7 @@ protected:
// members which have public access.
osg::Vec4 _color;
osg::ref_ptr<Font> _font;
osg::ref_ptr<Font> _fontFallback;
osg::ref_ptr<Style> _style;
FontResolution _fontSize;
float _characterHeight;
@@ -249,12 +249,11 @@ osg::StateSet* Text::createStateSet()

Font* Text::getActiveFont()
{
return _font.valid() ? _font.get() : Font::getDefaultFont().get();
}
if (_font.valid()) return _font.get();

const Font* Text::getActiveFont() const
{
return _font.valid() ? _font.get() : Font::getDefaultFont().get();
if (!_fontFallback) _fontFallback = Font::getDefaultFont();

return _fontFallback.get();
}

String::iterator Text::computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last)

0 comments on commit fd8019c

Please sign in to comment.
You can’t perform that action at this time.