diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index 84c240f77..b9d56fcaf 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -491,18 +491,20 @@ void Text::computeGlyphRepresentation() } } + + if (itr!=_text.end()) + { + // skip over spaces and return. + while (*itr==' ') ++itr; + if (*itr=='\n') ++itr; + } + } else { ++itr; } - if (itr!=_text.end()) - { - // skip over spaces and return. - while (*itr==' ') ++itr; - if (*itr=='\n') ++itr; - } // move to new line. switch(_layout)