Improved ratsnest updates performance during routing

This commit is contained in:
Tomasz Włostowski 2017-07-02 23:05:23 +02:00
parent eea41dbc6f
commit c01c25b258
1 changed files with 12 additions and 7 deletions

View File

@ -225,10 +225,10 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
switch( aItem->Type() ) switch( aItem->Type() )
{ {
case PCB_NETINFO_T: case PCB_NETINFO_T:
{ {
MarkNetAsDirty( static_cast<NETINFO_ITEM*>( aItem )->GetNet() ); MarkNetAsDirty( static_cast<NETINFO_ITEM*>( aItem )->GetNet() );
break; break;
} }
case PCB_MODULE_T: case PCB_MODULE_T:
for( auto pad : static_cast<MODULE*>( aItem ) -> Pads() ) for( auto pad : static_cast<MODULE*>( aItem ) -> Pads() )
{ {
@ -766,9 +766,14 @@ void CN_CONNECTIVITY_ALGO::propagateConnections()
{ {
if( item->CanChangeNet() ) if( item->CanChangeNet() )
{ {
item->Parent()->SetNetCode( cluster->OriginNet() ); if( item->Parent()->GetNetCode() != cluster->OriginNet() )
MarkNetAsDirty( cluster->OriginNet() ); {
n_changed++; MarkNetAsDirty( item->Parent()->GetNetCode() );
MarkNetAsDirty( cluster->OriginNet() );
item->Parent()->SetNetCode( cluster->OriginNet() );
n_changed++;
}
} }
} }