Performance improvement.

This commit is contained in:
Jeff Young 2022-03-10 00:01:13 +00:00
parent d3e9165146
commit eb9ccea559
1 changed files with 7 additions and 6 deletions

View File

@ -427,14 +427,15 @@ bool CONNECTIVITY_DATA::IsConnectedOnLayer( const BOARD_CONNECTED_ITEM *aItem, i
} }
else if( CN_ZONE_LAYER* zoneLayer = dynamic_cast<CN_ZONE_LAYER*>( connected ) ) else if( CN_ZONE_LAYER* zoneLayer = dynamic_cast<CN_ZONE_LAYER*>( connected ) )
{ {
ZONE* zone = static_cast<ZONE*>( zoneLayer->Parent() ); BOARD_CONNECTED_ITEM* item = zoneLayer->Parent();
int idx = zoneLayer->SubpolyIndex(); int islandIdx = zoneLayer->SubpolyIndex();
const SHAPE_LINE_CHAIN& island = zone->GetFill( layer )->COutline( idx );
std::shared_ptr<SHAPE> flashing = pad->GetEffectiveShape();
for( const VECTOR2I& pt : island.CPoints() ) const auto& fill = static_cast<ZONE*>( item )->GetFilledPolysList( layer );
const auto& padOutline = pad->GetEffectivePolygon()->Outline( 0 );
for( const VECTOR2I& pt : fill->COutline( islandIdx ).CPoints() )
{ {
if( !flashing->Collide( pt ) ) if( !padOutline.PointInside( pt ) )
return true; return true;
} }