From 61c7ee76c5c059f53366f69c27c9fdf69388eced Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 10 Jan 2020 10:12:13 +0000 Subject: [PATCH] Fixed handling of _autoScaleTransitionWidthRatio<=0.0 --- src/osg/AutoTransform.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/osg/AutoTransform.cpp b/src/osg/AutoTransform.cpp index 01b8936d7..0f9777e74 100644 --- a/src/osg/AutoTransform.cpp +++ b/src/osg/AutoTransform.cpp @@ -153,7 +153,7 @@ osg::Matrixd AutoTransform::computeMatrix(const osg::NodeVisitor* nv) const { double size = 1.0/cs->pixelSize(getPosition(),0.48f); - //if (_autoScaleTransitionWidthRatio>0.0) + if (_autoScaleTransitionWidthRatio>0.0) { if (_minimumScale>0.0) { @@ -185,6 +185,18 @@ osg::Matrixd AutoTransform::computeMatrix(const osg::NodeVisitor* nv) const else if (size>m) size = a + b*size + c*(size*size); } } + else + { + if (_minimumScale>0.0 && size<_minimumScale) + { + size = _minimumScale; + } + + if (_maximumScale_maximumScale) + { + size = _maximumScale; + } + } // TODO setScale(size); scale.set(size, size, size);