[osg-users] Call for testing, preparing for 3.5.6 dev release again :-)

jamie robertson jamierobertson1 at hotmail.com
Sun May 14 16:19:30 PDT 2017


Hi Robert,

A very minor one, but I've noticed that in osg::Text::computePositionsImplementation(), any bounding box margins set are never taken into account when calculating the position of the text, as the positions are calculated from the bounding box before the margins are applied.


Code:
void Text::computePositionsImplementation()
{
    TextBase::computePositionsImplementation();

    computeBackdropPositions();
    computeBackdropBoundingBox();
    computeBoundingBoxMargin();
}



For example if you set the text alignment to LEFT_BOTTOM and set a bounding box margin, the margin is not taken into account when calculating the position. 

Possibly it should be something like:


Code:
void Text::computePositionsImplementation()
void Text::computePositionsImplementation()
{
    TextBase::computePositionsImplementation();

    computeBackdropPositions();
    computeBackdropBoundingBox();
    computeBoundingBoxMargin();

	// Compute position again to include bounding box margins for non base-line text alignments
	if (_alignment < LEFT_BASE_LINE) 
		TextBase::computePositionsImplementation();
}



Cheers,

Jamie

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70920#70920








More information about the osg-users mailing list