Fixed handling of _autoScaleTransitionWidthRatio<=0.0

This commit is contained in:
Robert Osfield 2020-01-10 10:12:13 +00:00
parent 605821e655
commit 61c7ee76c5

View File

@ -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<DBL_MAX && size>_maximumScale)
{
size = _maximumScale;
}
}
// TODO setScale(size);
scale.set(size, size, size);