Fixed a small bug in compute bound that caused it to come up with the

wrong number if the coord array was indexed, and containing bogus
(unindexed, yet in-line) numbers.
This commit is contained in:
Don BURNS
2002-04-04 00:30:10 +00:00
parent 765d2f2183
commit 1de448df4a

View File

@@ -432,10 +432,21 @@ const bool GeoSet::computeBound() const
int i;
if( _iaformat == IA_OFF )
{
for( i = 0; i < _numcoords; i++ )
{
center += _coords[i];
_bbox.expandBy(_coords[i]);
if( _cindex.valid() )
{
for( i = 0; i < _numcoords; i++ )
{
center += _coords[_cindex[i]];
_bbox.expandBy(_coords[_cindex[i]]);
}
}
else
{
for( i = 0; i < _numcoords; i++ )
{
center += _coords[i];
_bbox.expandBy(_coords[i]);
}
}
}
else