From e94d6a0b30aebb0ac858b3952c35ce52fa4c3a51 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 13 Apr 2008 14:32:13 +0000 Subject: [PATCH] From Christian Kaser, "I discovered a bug that lead to a space being displayed at the start of the new line after an automatic line break (through setMaximumWidth()). The fix simply skips all spaces at the end of the line, before skipping a line break which was done already. osgText/Text.cpp: Line 502 ... else { ++itr; } if (itr!=_text.end()) { // skip over spaces and return. while (*itr==' ') ++itr; // New if (*itr=='\n') ++itr; } // move to new line. switch(_layout) { .." --- src/osgText/Text.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index e1bee2915..8ee03a518 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -499,7 +499,8 @@ void Text::computeGlyphRepresentation() if (itr!=_text.end()) { - // skip over return. + // skip over spaces and return. + while (*itr==' ') ++itr; if (*itr=='\n') ++itr; }