pcbnew: don't rebuild dynamic ratsnest when moving items without a net (e.g. board outlines)

Fixes: lp:1778321
* https://bugs.launchpad.net/kicad/+bug/1778321
This commit is contained in:
Tomasz Wlostowski 2018-06-25 16:29:20 +02:00
parent 847f4f50b1
commit 01c2d93a81
2 changed files with 34 additions and 2 deletions

View File

@ -224,13 +224,44 @@ void CONNECTIVITY_DATA::FindIsolatedCopperIslands( std::vector<CN_ZONE_ISOLATED_
m_connAlgo->FindIsolatedCopperIslands( aZones );
}
int CONNECTIVITY_DATA::countRelevantItems( const std::vector<BOARD_ITEM*>& aItems )
{
int n = 0;
for( const auto item : aItems )
{
switch( item->Type() )
{
case PCB_TRACE_T:
case PCB_PAD_T:
case PCB_ZONE_AREA_T:
case PCB_MODULE_T:
case PCB_VIA_T:
n++;
break;
default:
break;
}
}
return n;
}
void CONNECTIVITY_DATA::ComputeDynamicRatsnest( const std::vector<BOARD_ITEM*>& aItems )
{
if( countRelevantItems( aItems ) == 0 )
{
m_dynamicRatsnest.clear();
return ;
}
m_dynamicConnectivity.reset( new CONNECTIVITY_DATA );
m_dynamicConnectivity->Build( aItems );
m_dynamicRatsnest.clear();
BlockRatsnestItems( aItems );
for( unsigned int nc = 1; nc < m_dynamicConnectivity->m_nets.size(); nc++ )

View File

@ -236,7 +236,8 @@ public:
void SetProgressReporter( PROGRESS_REPORTER* aReporter );
private:
int countRelevantItems( const std::vector<BOARD_ITEM*>& aItems );
void updateRatsnest();
void addRatsnestCluster( const std::shared_ptr<CN_CLUSTER>& aCluster );