From cc4cc7b40362f6558cf571a0fce0ddf1623f8ce0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 20 Jun 2009 11:35:22 +0000 Subject: [PATCH] From Farshid Lashkari, "I found a bug in the osgText library in version 1.2 that I believe still exists in the latest version. I found that changing the alignment of a text object does not work properly if the text contains newline characters. I've attached a simple test case that shows the problem. If I set the text AFTER setting the alignment, everything works fine. But if I set the text BEFORE setting the alignment then the text is displayed incorrectly. The fix is very simple. Instead of calling computePositions() in TextBase::setAlignment(), it calls computeGlyphRepresentation(). I've attached the modified TextBase.cpp." --- src/osgText/TextBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgText/TextBase.cpp b/src/osgText/TextBase.cpp index 3ec468510..3237beeac 100644 --- a/src/osgText/TextBase.cpp +++ b/src/osgText/TextBase.cpp @@ -147,7 +147,7 @@ void TextBase::setAlignment(AlignmentType alignment) if (_alignment==alignment) return; _alignment = alignment; - computePositions(); + computeGlyphRepresentation(); } void TextBase::setAxisAlignment(AxisAlignment axis)