Browse Source

CONNECTIVITY_DATA::IsConnectedOnLayer(): fix crash in some cases.

Fix crash when a zone do not have filled areas on a given layer.
7.0
jean-pierre charras 4 years ago
parent
commit
7fb4a2c0a5
  1. 4
      pcbnew/connectivity/connectivity_data.cpp

4
pcbnew/connectivity/connectivity_data.cpp

@ -462,6 +462,9 @@ 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() ); ZONE* zone = static_cast<ZONE*>( zoneLayer->Parent() );
if( zone->GetFill( layer )->OutlineCount() )
{
int idx = zoneLayer->SubpolyIndex(); int idx = zoneLayer->SubpolyIndex();
const SHAPE_LINE_CHAIN& island = zone->GetFill( layer )->COutline( idx ); const SHAPE_LINE_CHAIN& island = zone->GetFill( layer )->COutline( idx );
SHAPE_CIRCLE flashing( via->GetCenter(), via->GetWidth() / 2 ); SHAPE_CIRCLE flashing( via->GetCenter(), via->GetWidth() / 2 );
@ -471,6 +474,7 @@ bool CONNECTIVITY_DATA::IsConnectedOnLayer( const BOARD_CONNECTED_ITEM *aItem, i
if( !flashing.SHAPE::Collide( pt ) ) if( !flashing.SHAPE::Collide( pt ) )
return true; return true;
} }
}
// If the entire island is inside the via's flashing then the via won't // If the entire island is inside the via's flashing then the via won't
// *actually* connect to anything *else* so don't consider it connected. // *actually* connect to anything *else* so don't consider it connected.

Loading…
Cancel
Save