From 2c2083db72b6889d5b4bd0272e5778f0eddc2d0c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 6 Jul 2006 08:36:12 +0000 Subject: [PATCH] From Vivek Rajan, "Rotated text in SCREEN_COORDS was looking a little squished especially in orthographic projection. Performing the rotation before the scaling fixed the problem. I've attached Text.cpp with the fix." From Robert Osfield, in keeping with Vivek's change moved the auto rotate to screen befor the scale as well. --- src/osgText/Text.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index c06929cb3..a9262d8e3 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -764,6 +764,16 @@ void Text::computePositions(unsigned int contextID) const atc._modelview.setTrans(trans); } + if (!_rotation.zeroRotation() ) + { + matrix.postMult(osg::Matrix::rotate(_rotation)); + } + + if (_autoRotateToScreen) + { + matrix.postMult(rotate_matrix); + } + if (_characterSizeMode!=OBJECT_COORDS) { @@ -822,16 +832,6 @@ void Text::computePositions(unsigned int contextID) const } - if (_autoRotateToScreen) - { - matrix.postMult(rotate_matrix); - } - - if (!_rotation.zeroRotation() ) - { - matrix.postMult(osg::Matrix::rotate(_rotation)); - } - matrix.postMult(osg::Matrix::translate(_position)); } else if (!_rotation.zeroRotation())