Fixed a bug on the handling of empty EncodedText.

This commit is contained in:
Robert Osfield
2003-01-17 15:01:27 +00:00
parent f87dc60ddd
commit a86d519a89
5 changed files with 25 additions and 18 deletions

View File

@@ -178,7 +178,7 @@ bool Font::create(osg::State& state)
void Font::output(osg::State& state, const EncodedText* text) const
{
if(_created)
_font->render(text->getUnicodeText(),state.getContextID());
_font->render(text->begin(),text->end(),state.getContextID());
else
{
// ahhhh, this is bit doddy, the draw is potentially
@@ -204,8 +204,8 @@ void Font::clear()
float Font::
getWidth(const EncodedText* text) const
{
if(_init && _created)
return _font->Advance(text->getUnicodeText());
if(_init && _created && text)
return _font->Advance(text->begin(),text->end());
else
return -1;
}