Added new setFont(ref_ptr<>) variants to Text and Text3D
This commit is contained in:
@@ -67,12 +67,12 @@ Text::~Text()
|
||||
{
|
||||
}
|
||||
|
||||
void Text::setFont(Font* font)
|
||||
void Text::setFont(osg::ref_ptr<Font> font)
|
||||
{
|
||||
if (_font==font) return;
|
||||
|
||||
osg::StateSet* previousFontStateSet = _font.valid() ? _font->getStateSet() : DefaultFont::instance()->getStateSet();
|
||||
osg::StateSet* newFontStateSet = font ? font->getStateSet() : DefaultFont::instance()->getStateSet();
|
||||
osg::StateSet* newFontStateSet = font.valid() ? font->getStateSet() : DefaultFont::instance()->getStateSet();
|
||||
|
||||
if (getStateSet() == previousFontStateSet)
|
||||
{
|
||||
@@ -86,7 +86,7 @@ void Text::setFont(Font* font)
|
||||
|
||||
void Text::setFont(const std::string& fontfile)
|
||||
{
|
||||
setFont(readRefFontFile(fontfile).get());
|
||||
setFont(readRefFontFile(fontfile));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Text3D::Text3D(const Text3D & text3D, const osg::CopyOp & copyop):
|
||||
// TODO
|
||||
//}
|
||||
|
||||
void Text3D::setFont(Font3D * font)
|
||||
void Text3D::setFont(osg::ref_ptr<Font3D> font)
|
||||
{
|
||||
_font = font;
|
||||
|
||||
@@ -51,7 +51,7 @@ void Text3D::setFont(Font3D * font)
|
||||
|
||||
void Text3D::setFont(const std::string & fontfile)
|
||||
{
|
||||
setFont(readRefFont3DFile(fontfile).get());
|
||||
setFont(readRefFont3DFile(fontfile));
|
||||
}
|
||||
|
||||
String::iterator Text3D::computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last)
|
||||
|
||||
Reference in New Issue
Block a user