VIEW_GROUP: correctly calculate group extents
This commit is contained in:
parent
838458bc3a
commit
26177efba0
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue