From aa621e1a4ae3e462d9af13d6677f1af9f03aee5f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 24 Feb 2017 11:08:15 +0000 Subject: [PATCH] Grouped GlyphQuad setup --- src/osgText/Text.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index 53987bd08..1b08f9910 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -419,10 +419,6 @@ void Text::computeGlyphRepresentation() local.x() += bearing.x() * wr; local.y() += bearing.y() * hr; - GlyphQuads& glyphquad = _textureGlyphQuadMap[glyph->getTexture()]; - - glyphquad._glyphs.push_back(glyph); - glyphquad._lineNumbers.push_back(lineNumber); // Adjust coordinates and texture coordinates to avoid // clipping the edges of antialiased characters. @@ -445,6 +441,12 @@ void Text::computeGlyphRepresentation() osg::Vec2 lowLeft = local+osg::Vec2(0.0f-fHorizQuadMargin,0.0f-fVertQuadMargin); osg::Vec2 lowRight = local+osg::Vec2(width+fHorizQuadMargin,0.0f-fVertQuadMargin); osg::Vec2 upRight = local+osg::Vec2(width+fHorizQuadMargin,height+fVertQuadMargin); + + GlyphQuads& glyphquad = _textureGlyphQuadMap[glyph->getTexture()]; + + glyphquad._glyphs.push_back(glyph); + glyphquad._lineNumbers.push_back(lineNumber); + glyphquad.addCoord(upLeft); glyphquad.addCoord(lowLeft); glyphquad.addCoord(lowRight);