From a2447c8dc0cd30dba9475844debe21c1e4a104df Mon Sep 17 00:00:00 2001 From: gwaldron Date: Mon, 21 May 2018 13:26:04 -0400 Subject: [PATCH] osgText: perform pixel size computation in double-precision to prevent coordinate jitter --- src/osgText/TextBase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgText/TextBase.cpp b/src/osgText/TextBase.cpp index bce1a3cd3..ac64d480d 100644 --- a/src/osgText/TextBase.cpp +++ b/src/osgText/TextBase.cpp @@ -514,9 +514,9 @@ bool TextBase::computeMatrix(osg::Matrix& matrix, osg::State* state) const osg::Matrix mvpw = rotate_matrix * modelview * projection * osg::Matrix::scale(width/2.0, height/2.0, 1.0); - osg::Vec3 origin = osg::Vec3(0.0, 0.0, 0.0) * mvpw; - osg::Vec3 left = osg::Vec3(1.0, 0.0, 0.0) * mvpw - origin; - osg::Vec3 up = osg::Vec3(0.0, 1.0, 0.0) * mvpw - origin; + osg::Vec3d origin = osg::Vec3d(0.0, 0.0, 0.0) * mvpw; + osg::Vec3d left = osg::Vec3d(1.0, 0.0, 0.0) * mvpw - origin; + osg::Vec3d up = osg::Vec3d(0.0, 1.0, 0.0) * mvpw - origin; // compute the pixel size vector. value_type length_x = left.length();