Simplified and improved the glyph margin computation and usage

This commit is contained in:
Robert Osfield
2017-09-29 20:21:13 +01:00
parent beb5801eee
commit d2fa7c4317
8 changed files with 41 additions and 116 deletions

View File

@@ -464,8 +464,6 @@ void Text::computeGlyphRepresentation()
float hr = _characterHeight;
float wr = hr/getCharacterAspectRatio();
float texelMargin = 5.0f;
for(String::iterator itr=_text.begin();
itr!=_text.end();
)
@@ -632,6 +630,7 @@ void Text::computeGlyphRepresentation()
osg::Vec2 mintc = glyph->getMinTexCoord();
osg::Vec2 maxtc = glyph->getMaxTexCoord();
osg::Vec2 vDiff = maxtc - mintc;
float texelMargin = glyph->getTexelMargin();
float fHorizTCMargin = texelMargin / glyph->getTexture()->getTextureWidth();
float fVertTCMargin = texelMargin / glyph->getTexture()->getTextureHeight();