From bb5fd5a2eca12d0eed20c0d91ed55a436697c22c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 9 Jun 2022 00:04:49 +0100 Subject: [PATCH] Fix broken logic for hidden pins. Fixes https://gitlab.com/kicad/code/kicad/issues/11771 (cherry picked from commit b710982875e05d3f11326fd6dbe8bcad39dadce6) --- eeschema/lib_symbol.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/eeschema/lib_symbol.cpp b/eeschema/lib_symbol.cpp index 7b9f23ff47..316a47ba28 100644 --- a/eeschema/lib_symbol.cpp +++ b/eeschema/lib_symbol.cpp @@ -932,13 +932,16 @@ const EDA_RECT LIB_SYMBOL::GetBodyBoundingBox( int aUnit, int aConvert, bool aIn { const LIB_PIN& pin = static_cast( item ); - // Note: the roots of the pins are always included for symbols that don't have a - // well-defined body. + if( pin.IsVisible() ) + { + // Note: the roots of the pins are always included for symbols that don't have + // a well-defined body. - if( aIncludePins && pin.IsVisible() ) - bbox.Merge( pin.GetBoundingBox( false, true ) ); - else - bbox.Merge( pin.GetPinRoot() ); + if( aIncludePins ) + bbox.Merge( pin.GetBoundingBox( false, true ) ); + else + bbox.Merge( pin.GetPinRoot() ); + } } else {