diff --git a/common/view/view_group.cpp b/common/view/view_group.cpp index 65526870cd..281672a84b 100644 --- a/common/view/view_group.cpp +++ b/common/view/view_group.cpp @@ -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 ) {