diff --git a/include/pcb_group.h b/include/pcb_group.h index d4d55ec085..e389cd9b7b 100644 --- a/include/pcb_group.h +++ b/include/pcb_group.h @@ -124,6 +124,12 @@ public: wxFAIL_MSG( wxT( "groups don't support layer SetLayer" ) ); } + bool IsOnCopperLayer() const override + { + // A group might have members on a copper layer, but isn't itself on any layer. + return false; + } + /** Set layer for all items within the group. * * To avoid freezes with circular references, the maximum depth is 20 by default. diff --git a/libs/kimath/include/geometry/shape_compound.h b/libs/kimath/include/geometry/shape_compound.h index c4c333cb03..0e26bd70ed 100644 --- a/libs/kimath/include/geometry/shape_compound.h +++ b/libs/kimath/include/geometry/shape_compound.h @@ -81,7 +81,7 @@ public: void AddShape( SHAPE* aShape ) { // Don't make clients deal with nested SHAPE_COMPOUNDs - if( aShape->HasIndexableSubshapes() ) + if( dynamic_cast( aShape ) ) { std::vector subshapes; aShape->GetIndexableSubshapes( subshapes ); @@ -102,7 +102,7 @@ public: void AddShape( std::shared_ptr aShape ) { // Don't make clients deal with nested SHAPE_COMPOUNDs - if( aShape->HasIndexableSubshapes() ) + if( dynamic_cast( aShape.get() ) ) { std::vector subshapes; aShape->GetIndexableSubshapes( subshapes ); @@ -125,7 +125,7 @@ public: int Size() const { - return m_shapes.size(); + return (int) m_shapes.size(); } void Rotate( const EDA_ANGLE& aAngle, const VECTOR2I& aCenter = { 0, 0 } ) override; diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 7e320098df..13c7510f9a 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -2547,7 +2547,17 @@ void FOOTPRINT::CheckNetTies( const std::functionIsOnCopperLayer() ) + { copperItems.push_back( item ); + } + else if( PCB_GROUP* group = dynamic_cast( item ) ) + { + group->RunOnDescendants( [&]( BOARD_ITEM* descendent ) + { + if( descendent->IsOnCopperLayer() ) + copperItems.push_back( descendent ); + } ); + } } for( ZONE* zone : m_fp_zones )