view_layers: Initialize variables
Fixes a couple spots where uninitialized variables cause unknown results.
This commit is contained in:
parent
bfa7f16b44
commit
a16e21665a
|
@ -92,22 +92,17 @@ VIEW_ITEM *VIEW_GROUP::GetItem( unsigned int idx ) const
|
|||
const BOX2I VIEW_GROUP::ViewBBox() const
|
||||
{
|
||||
BOX2I bb;
|
||||
bool first;
|
||||
|
||||
if( !m_groupItems.size() )
|
||||
{
|
||||
bb.SetMaximum();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
bb = m_groupItems[0]->ViewBBox();
|
||||
|
||||
for( auto item : m_groupItems )
|
||||
{
|
||||
if( first )
|
||||
{
|
||||
bb = item->ViewBBox();
|
||||
first = false;
|
||||
} else {
|
||||
bb.Merge( item->ViewBBox() );
|
||||
}
|
||||
}
|
||||
bb.Merge( item->ViewBBox() );
|
||||
}
|
||||
|
||||
return bb;
|
||||
|
@ -141,7 +136,8 @@ void VIEW_GROUP::ViewDraw( int aLayer, VIEW* aView ) const
|
|||
}
|
||||
}
|
||||
|
||||
int layers[VIEW::VIEW_MAX_LAYERS], layers_count = 0;
|
||||
int layers[VIEW::VIEW_MAX_LAYERS] = { 0 };
|
||||
int layers_count = 0;
|
||||
|
||||
for( const auto& entry : layer_item_map )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue