CanvasGroup: return empty bounding box without children.

Return an invalid bounding box can lead to problems
if used unchecked. Just returning an empty bounding
box (size 0x0 and position at the origin of the
element) is much safer.
This commit is contained in:
Thomas Geymayer
2014-03-19 16:31:17 +01:00
parent 6c75e2fe3c
commit 3525fff8d0

View File

@@ -220,7 +220,10 @@ namespace canvas
//----------------------------------------------------------------------------
osg::BoundingBox Group::getTransformedBounds(const osg::Matrix& m) const
{
osg::BoundingBox bb;
// Default to a bounding box with size 0x0 and the origin defined by the
// matrix.
osg::BoundingBox bb(m.getTrans(), m.getTrans());
if( !_transform.valid() )
{
warnTransformExpired("getTransformedBounds");