diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index d3f57c596b..63c6efb430 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -986,7 +986,10 @@ bool ZONE::IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) const void ZONE::GetInteractingZones( PCB_LAYER_ID aLayer, std::vector* aZones ) const { - int epsilon = Millimeter2iu( 0.001 ); + int epsilon = Millimeter2iu( 0.001 ); + BOX2I bbox = GetCachedBoundingBox(); + + bbox.Inflate( epsilon ); for( ZONE* candidate : GetBoard()->Zones() ) { @@ -1002,6 +1005,9 @@ void ZONE::GetInteractingZones( PCB_LAYER_ID aLayer, std::vector* aZones if( candidate->GetNetCode() != GetNetCode() ) continue; + if( !candidate->GetCachedBoundingBox().Intersects( bbox ) ) + continue; + for( auto iter = m_Poly->CIterate(); iter; iter++ ) { if( candidate->m_Poly->Collide( iter.Get(), epsilon ) )