From 1ade5a8c7219b35059d20129c2c10b6300db9e38 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 17 Jul 2022 17:03:15 +0100 Subject: [PATCH] Fix typo. And clean up the code just a little to make it clearer. Fixes https://gitlab.com/kicad/code/kicad/issues/12022 --- pcbnew/footprint.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index ebdc342611..aefebe85c1 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -787,14 +787,19 @@ const EDA_RECT FOOTPRINT::GetBoundingBox( bool aIncludeText, bool aIncludeInvisi for( BOARD_ITEM* item : m_drawings ) { - // We want the bitmap bounding box just in the footprint editor - // so it will start with the correct initial zoom - if( !isFPEdit - && ( m_privateLayers.test( item->GetLayer() ) || item->Type() != PCB_BITMAP_T ) ) + if( m_privateLayers.test( item->GetLayer() ) && !isFPEdit ) continue; - if( item->Type() != PCB_FP_TEXT_T ) - area.Merge( item->GetBoundingBox() ); + // We want the bitmap bounding box just in the footprint editor + // so it will start with the correct initial zoom + if( item->Type() == PCB_BITMAP_T && !isFPEdit ) + continue; + + // Handle text separately + if( item->Type() == PCB_FP_TEXT_T ) + continue; + + area.Merge( item->GetBoundingBox() ); } for( PAD* pad : m_pads )