From a407befa4c6b73fb1b8bc6836c25f3182dbb28e0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 13 Aug 2020 00:17:44 +0100 Subject: [PATCH] Fix breakage from layer change. We have to be careful about processing edges on the Edge_Cuts even when we're talking about a zone on some other layer. --- pcbnew/zone_filler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 30bf3777f1..09cf5f6c1f 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -569,6 +569,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE_CONTAINER* aZone, PCB_LA SHAPE_POLY_SET& aHoles ) { static DRAWSEGMENT dummyEdge; + dummyEdge.SetParent( m_board ); dummyEdge.SetLayer( Edge_Cuts ); // a small extra clearance to be sure actual track clearance is not smaller @@ -675,10 +676,18 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE_CONTAINER* aZone, PCB_LA if( aItem->GetBoundingBox().Intersects( zone_boundingbox ) ) { - bool ignoreLineWidth = aItem->IsOnLayer( Edge_Cuts ); + PCB_LAYER_ID layer = aLayer; + bool ignoreLineWidth = false; + + if( aItem->IsOnLayer( Edge_Cuts ) ) + { + layer = Edge_Cuts; + ignoreLineWidth = true; + } + int gap = aZone->GetClearance( aLayer, aItem ); - addKnockout( aItem, aLayer, gap, ignoreLineWidth, aHoles ); + addKnockout( aItem, layer, gap, ignoreLineWidth, aHoles ); } };