diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 2bbfb2f4ca..49868a78e1 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -536,7 +536,9 @@ int PNS_PCBNEW_RULE_RESOLVER::Clearance( const PNS::ITEM* aA, const PNS::ITEM* a rv = constraint.m_Value.Min(); } } - else if( isCopper( aA ) && ( !aB || isCopper( aB ) ) ) + + // No 'else'; plated holes get both HOLE_CLEARANCE and CLEARANCE + if( isCopper( aA ) && ( !aB || isCopper( aB ) ) ) { if( QueryConstraint( PNS::CONSTRAINT_TYPE::CT_CLEARANCE, aA, aB, layer, &constraint ) ) { diff --git a/pcbnew/router/router_preview_item.cpp b/pcbnew/router/router_preview_item.cpp index 5dd443e034..fbefe98166 100644 --- a/pcbnew/router/router_preview_item.cpp +++ b/pcbnew/router/router_preview_item.cpp @@ -256,6 +256,7 @@ void ROUTER_PREVIEW_ITEM::drawLineChain( const SHAPE_LINE_CHAIN_BASE* aL, KIGFX: void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) const { bool holeDrawn = false; + bool showClearance = m_showClearance || ( m_flags | PNS_COLLISION ) > 0; switch( aShape->Type() ) { @@ -263,7 +264,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons { const SHAPE_LINE_CHAIN_BASE* l = (const SHAPE_LINE_CHAIN_BASE*) aShape; - if( m_showClearance && m_clearance > 0 ) + if( showClearance && m_clearance > 0 ) { gal->SetLineWidth( m_width + 2 * m_clearance ); drawLineChain( l, gal ); @@ -282,7 +283,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons const SHAPE_LINE_CHAIN* l = (const SHAPE_LINE_CHAIN*) aShape; const int w = m_width; - if( m_showClearance && m_clearance > 0 ) + if( showClearance && m_clearance > 0 ) { gal->SetLineWidth( w + 2 * m_clearance ); drawLineChain( l, gal ); @@ -303,7 +304,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons gal->SetIsStroke( false ); - if( m_showClearance && m_clearance > 0 ) + if( showClearance && m_clearance > 0 ) { gal->SetLineWidth( w + 2 * m_clearance ); gal->DrawSegment( s->GetSeg().A, s->GetSeg().B, s->GetWidth() + 2 * m_clearance ); @@ -321,7 +322,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons const SHAPE_CIRCLE* c = static_cast( aShape ); gal->SetStrokeColor( m_color ); - if( m_showClearance && m_clearance > 0 ) + if( showClearance && m_clearance > 0 ) { gal->SetIsStroke( false ); gal->DrawCircle( c->GetCenter(), c->GetRadius() + m_clearance ); @@ -357,7 +358,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons const SHAPE_RECT* r = (const SHAPE_RECT*) aShape; gal->SetFillColor( m_color ); - if( m_showClearance && m_clearance > 0 ) + if( showClearance && m_clearance > 0 ) { VECTOR2I p0( r->GetPosition() ), s( r->GetSize() ); gal->SetIsStroke( true ); @@ -389,7 +390,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons gal->SetFillColor( m_color ); - if( m_showClearance && m_clearance > 0 ) + if( showClearance && m_clearance > 0 ) { gal->SetIsStroke( true ); gal->SetLineWidth( 2 * m_clearance ); @@ -417,7 +418,7 @@ void ROUTER_PREVIEW_ITEM::drawShape( const SHAPE* aShape, KIGFX::GAL* gal ) cons gal->SetIsFill( false ); gal->SetIsStroke( true ); - if( m_showClearance && m_clearance > 0 ) + if( showClearance && m_clearance > 0 ) { gal->SetLineWidth( w + 2 * m_clearance ); gal->DrawArc( arc->GetCenter(), arc->GetRadius(), start_angle, angle );