From Tree, tweaks to the coord generation to improve text alignment.

This commit is contained in:
Robert Osfield
2003-12-09 10:42:30 +00:00
parent 1f219f5a7e
commit 58c872c662

View File

@@ -355,7 +355,7 @@ void Font::GlyphTexture::addGlyph(Glyph* glyph, int posX, int posY)
glyph->setTexture(this);
glyph->setTexturePosition(posX,posY);
unsigned int sizeAdjustment = 0; // was 1.
glyph->setMinTexCoord(osg::Vec2((float)(posX+_margin-1)/(float)(getTextureWidth()-sizeAdjustment),(float)(posY+_margin-1)/(float)(getTextureHeight()-sizeAdjustment)));
glyph->setMinTexCoord(osg::Vec2((float)(posX+_margin)/(float)(getTextureWidth()-sizeAdjustment),(float)(posY+_margin)/(float)(getTextureHeight()-sizeAdjustment)));
glyph->setMaxTexCoord(osg::Vec2((float)(posX+glyph->s()-_margin)/(float)(getTextureWidth()-sizeAdjustment),(float)(posY+glyph->t()-_margin)/(float)(getTextureHeight()-sizeAdjustment)));
}