From e91218b876eddbc8269bf68c1f0bed536a5d0c83 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 8 Aug 2021 15:41:39 -0400 Subject: [PATCH] PNS: don't mark holes only if there's also a solid violation Fixes https://gitlab.com/kicad/code/kicad/-/issues/8874 --- pcbnew/router/pns_router.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index e65758f89a..6ef6915ebc 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -462,10 +462,13 @@ void ROUTER::markViolations( NODE* aNode, ITEM_SET& aCurrent, NODE::ITEM_VECTOR& [&]( ITEM* currentItem, ITEM* itemToMark ) { std::unique_ptr tmp( itemToMark->Clone() ); - int clearance; - bool removeOriginal = true; - if( itemToMark->Marker() & MK_HOLE ) + int clearance; + bool removeOriginal = true; + bool holeOnly = ( ( itemToMark->Marker() & MK_HOLE ) + && !( itemToMark->Marker() & MK_VIOLATION ) ); + + if( holeOnly ) clearance = aNode->GetHoleClearance( currentItem, itemToMark ); else clearance = aNode->GetClearance( currentItem, itemToMark ); @@ -475,8 +478,7 @@ void ROUTER::markViolations( NODE* aNode, ITEM_SET& aCurrent, NODE::ITEM_VECTOR& if( itemToMark->Kind() == ITEM::SOLID_T ) { - if( ( itemToMark->Marker() & PNS::MK_HOLE ) - || !m_iface->IsFlashedOnLayer( itemToMark, itemToMark->Layer() ) ) + if( holeOnly || !m_iface->IsFlashedOnLayer( itemToMark, itemToMark->Layer() ) ) { SOLID* solid = static_cast( tmp.get() ); solid->SetShape( solid->Hole()->Clone() );