diff --git a/eeschema/sch_rule_area.cpp b/eeschema/sch_rule_area.cpp index 6800ac312d..bfc30f38d4 100644 --- a/eeschema/sch_rule_area.cpp +++ b/eeschema/sch_rule_area.cpp @@ -227,9 +227,7 @@ void SCH_RULE_AREA::RefreshContainedItemsAndDirectives( assert( labelConnectionPoints.size() == 1 ); if( GetPolyShape().CollideEdge( labelConnectionPoints[0], nullptr, 5 ) ) - { addDirective( label, view ); - } } // If directives have changed, we need to force an update of the contained items connectivity @@ -248,9 +246,7 @@ void SCH_RULE_AREA::RefreshContainedItemsAndDirectives( lineItem->GetLineWidth() ); if( GetPolyShape().Collide( &lineSeg ) ) - { addContainedItem( areaItem ); - } } else if( areaItem->IsType( { SCH_PIN_T, SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T } ) ) @@ -259,13 +255,20 @@ void SCH_RULE_AREA::RefreshContainedItemsAndDirectives( assert( connectionPoints.size() == 1 ); if( GetPolyShape().Collide( connectionPoints[0] ) ) - { addContainedItem( areaItem ); - } } else if( areaItem->IsType( { SCH_SYMBOL_T } ) ) { addContainedItem( areaItem ); + + // Add child pins which are within the rule area + const SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( areaItem ); + + for( SCH_PIN* pin : symbol->GetPins() ) + { + if( GetPolyShape().Collide( pin->GetPosition() ) ) + addContainedItem( pin ); + } } } }