VIEW_GROUP: correctly calculate group extents

This commit is contained in:
Tomasz Wlostowski 2018-08-03 13:59:15 +02:00 committed by Jeff Young
parent 838458bc3a
commit 26177efba0
1 changed files with 19 additions and 3 deletions

View File

@ -91,10 +91,26 @@ VIEW_ITEM *VIEW_GROUP::GetItem( unsigned int idx ) const
const BOX2I VIEW_GROUP::ViewBBox() const
{
BOX2I maxBox;
BOX2I bb;
bool first;
maxBox.SetMaximum();
return maxBox;
if( !m_groupItems.size() )
{
bb.SetMaximum();
} else {
for( auto item : m_groupItems )
{
if( first )
{
bb = item->ViewBBox();
first = false;
} else {
bb.Merge( item->ViewBBox() );
}
}
}
return bb;
}