Skip to content

Commit b2ffab0

Browse files
committed
IECoreGL::TextPrimitive : Fix warning C4701
- Rename second `b` variable and expand bound calculation in loop.
1 parent 50e46b5 commit b2ffab0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/IECoreGL/TextPrimitive.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ TextPrimitive::TextPrimitive( const std::string &text, FontPtr font )
6262
V2f advanceSum( 0 );
6363
for( unsigned i=0; i<m_text.size(); i++ )
6464
{
65-
Box2f b = m_font->coreFont()->bound( m_text[i] );
66-
b.min += advanceSum;
67-
b.max += advanceSum;
65+
Box2f characterB = m_font->coreFont()->bound( m_text[i] );
66+
characterB.min += advanceSum;
67+
characterB.max += advanceSum;
68+
b.extendBy( characterB );
6869
if( i<m_text.size() - 1 )
6970
{
7071
V2f a = m_font->coreFont()->advance( m_text[i], m_text[i+1] );

0 commit comments

Comments
 (0)