From Farshid Lashkari, "I've modified some setter methods of TextBase to avoid unnecessary calls to computeGlyphRepresentation() if the value has not changed."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14912 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -105,12 +105,17 @@ void TextBase::setFont(const std::string& fontfile)
|
||||
|
||||
void TextBase::setFontResolution(unsigned int width, unsigned int height)
|
||||
{
|
||||
_fontSize = FontResolution(width,height);
|
||||
FontResolution size(width,height);
|
||||
if (_fontSize==size) return;
|
||||
|
||||
_fontSize = size;
|
||||
computeGlyphRepresentation();
|
||||
}
|
||||
|
||||
void TextBase::setCharacterSize(float height)
|
||||
{
|
||||
if (_characterHeight==height) return;
|
||||
|
||||
_characterHeight = height;
|
||||
computeGlyphRepresentation();
|
||||
}
|
||||
@@ -126,18 +131,24 @@ void TextBase::setCharacterSize(float height, float aspectRatio)
|
||||
|
||||
void TextBase::setMaximumWidth(float maximumWidth)
|
||||
{
|
||||
if (_maximumWidth==maximumWidth) return;
|
||||
|
||||
_maximumWidth = maximumWidth;
|
||||
computeGlyphRepresentation();
|
||||
}
|
||||
|
||||
void TextBase::setMaximumHeight(float maximumHeight)
|
||||
{
|
||||
if (_maximumHeight==maximumHeight) return;
|
||||
|
||||
_maximumHeight = maximumHeight;
|
||||
computeGlyphRepresentation();
|
||||
}
|
||||
|
||||
void TextBase::setLineSpacing(float lineSpacing)
|
||||
{
|
||||
if (_lineSpacing==lineSpacing) return;
|
||||
|
||||
_lineSpacing = lineSpacing;
|
||||
computeGlyphRepresentation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user