From ba68b72a04aaf50b09aae99f6c05038e7e0eadab Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 8 Feb 2009 19:30:30 +0000 Subject: [PATCH] Fixed handling of a series of \n in the text string so that the correct line spacing is maintained. --- src/osgText/Text.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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)