Don't try and use zone fill before it's been calculated.

This commit is contained in:
Jeff Young 2022-05-16 15:20:01 +01:00
parent f2fc78f380
commit 4b668269b7
1 changed files with 8 additions and 1 deletions

View File

@ -201,7 +201,14 @@ bool calcIsInsideCourtyard( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox,
return false;
if( !aItemShape )
aItemShape = aItem->GetEffectiveShape( aCtx->GetLayer() );
{
// Since rules are used for zone filling we can't rely on the filled shapes.
// Use the zone outline instead.
if( ZONE* zone = dynamic_cast<ZONE*>( aItem ) )
aItemShape.reset( zone->Outline()->Clone() );
else
aItemShape = aItem->GetEffectiveShape( aCtx->GetLayer() );
}
return footprintCourtyard.Collide( aItemShape.get() );
};