diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index 22fc445a4c..cc7c1571f9 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -183,11 +183,11 @@ bool PAD::IsFlipped() const } -bool PAD::FlashLayer( LSET aLayers, bool aIncludeZones ) const +bool PAD::FlashLayer( LSET aLayers ) const { for( auto layer : aLayers.Seq() ) { - if( FlashLayer( layer, aIncludeZones ) ) + if( FlashLayer( layer ) ) return true; } @@ -195,20 +195,10 @@ bool PAD::FlashLayer( LSET aLayers, bool aIncludeZones ) const } -bool PAD::FlashLayer( int aLayer, bool aIncludeZones ) const +bool PAD::FlashLayer( int aLayer ) const { - std::vector types{ PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T }; - - /** - * Normally, we don't need to include zones in our flash check because the - * zones will fill over the hole. But, when we are drawing the pad in - * pcbnew, it is helpful to show the annular ring where the pad is connected - */ - if( aIncludeZones ) - { - types.push_back( PCB_ZONE_T ); - types.push_back( PCB_FP_ZONE_T ); - } + std::vector types + { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T, PCB_ZONE_T, PCB_FP_ZONE_T }; // Return the "normal" shape if the caller doesn't specify a particular layer if( aLayer == UNDEFINED_LAYER ) diff --git a/pcbnew/pad.h b/pcbnew/pad.h index 9f75e3e4db..5c68692a8a 100644 --- a/pcbnew/pad.h +++ b/pcbnew/pad.h @@ -563,20 +563,18 @@ public: * Check to see whether the pad should be flashed on the specific layer. * * @param aLayer Layer to check for connectivity - * @param aIncludeZones We include zones in potentially connected elements when drawing * @return true if connected by pad or track (or optionally zone) */ - bool FlashLayer( int aLayer, bool aIncludeZones = false ) const; + bool FlashLayer( int aLayer ) const; /** * Check to see if the pad should be flashed to any of the layers in the set. * * @param aLayers set of layers to check the via against - * @param aIncludeZones We include zones in potentially connected elements when drawing * @return true if connected by pad or track (or optionally zone) on any of the associated * layers */ - bool FlashLayer( LSET aLayers, bool aIncludeZones = false ) const; + bool FlashLayer( LSET aLayers ) const; bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override; bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override; diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 4763b5afe5..182d26de8a 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -618,7 +618,7 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer ) for( unsigned int layer : m_pcbSettings.GetHighContrastLayers() ) { - if( aVia->FlashLayer( static_cast( layer ), true ) ) + if( aVia->FlashLayer( static_cast( layer ) ) ) { draw = true; break; diff --git a/pcbnew/track.cpp b/pcbnew/track.cpp index 230d998809..731cb348ad 100644 --- a/pcbnew/track.cpp +++ b/pcbnew/track.cpp @@ -467,7 +467,7 @@ void VIA::SanitizeLayers() } -bool VIA::FlashLayer( LSET aLayers, bool aIncludeZones ) const +bool VIA::FlashLayer( LSET aLayers ) const { for( auto layer : aLayers.Seq() ) { @@ -479,20 +479,10 @@ bool VIA::FlashLayer( LSET aLayers, bool aIncludeZones ) const } -bool VIA::FlashLayer( int aLayer, bool aIncludeZones ) const +bool VIA::FlashLayer( int aLayer ) const { - std::vector types{ PCB_TRACE_T, PCB_ARC_T, PCB_PAD_T }; - - /** - * Normally, we don't need to include zones in our flash check because the - * zones will fill over the hole. But, when we are drawing the via in - * pcbnew, it is helpful to show the annular ring where the via is connected - */ - if( aIncludeZones ) - { - types.push_back( PCB_ZONE_T ); - types.push_back( PCB_FP_ZONE_T ); - } + std::vector types + { PCB_TRACE_T, PCB_ARC_T, PCB_PAD_T, PCB_ZONE_T, PCB_FP_ZONE_T }; // Return the "normal" shape if the caller doesn't specify a particular layer if( aLayer == UNDEFINED_LAYER ) diff --git a/pcbnew/track.h b/pcbnew/track.h index 77faf95f4c..48d0c31525 100644 --- a/pcbnew/track.h +++ b/pcbnew/track.h @@ -456,18 +456,16 @@ public: /** * Checks to see whether the via should have a pad on the specific layer * @param aLayer Layer to check for connectivity - * @param aIncludeZones We include zones in potentially connected elements when drawing * @return true if connected by pad or track (or optionally zone) */ - bool FlashLayer( int aLayer, bool aIncludeZones = false ) const; + bool FlashLayer( int aLayer ) const; /** * Checks to see if the via is present on any of the layers in the set * @param aLayers set of layers to check the via against - * @param aIncludeZones We include zones in potentially connected elements when drawing * @return true if connected by pad or track (or optionally zone) on any of the associated layers */ - bool FlashLayer( LSET aLayers, bool aIncludeZones = false ) const; + bool FlashLayer( LSET aLayers ) const; /** * Function SetDrill diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 2063e7ab4e..a076d408d2 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -618,7 +618,7 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer // If the pad isn't on the current layer but has a hole, knock out a thermal relief // for the hole. - if( !pad->FlashLayer( aLayer ) ) + if( !pad->FlashLayer( aLayer ) && pad->GetNetCode() != aZone->GetNetCode() ) { if( pad->GetDrillSize().x == 0 && pad->GetDrillSize().y == 0 ) continue; @@ -696,8 +696,8 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa gap += extra_margin; // If the pad isn't on the current layer but has a hole, knock out the - // hole. - if( !aPad->FlashLayer( aLayer ) ) + // hole. If the zone and the pad are the same layer, we still need the annular ring knockout + if( !aPad->FlashLayer( aLayer ) && aPad->GetNetCode() != aZone->GetNetCode() ) { if( aPad->GetDrillSize().x == 0 && aPad->GetDrillSize().y == 0 ) return; @@ -748,7 +748,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa { VIA* via = static_cast( aTrack ); - if( !via->FlashLayer( aLayer ) ) + if( !via->FlashLayer( aLayer ) && via->GetNetCode() != aZone->GetNetCode() ) { int radius = via->GetDrillValue() / 2 + bds.GetHolePlatingThickness(); TransformCircleToPolygon( aHoles, via->GetPosition(), radius + gap,