Fixed crash when redrawing ratsnest after swapping pad net assignments

This commit is contained in:
Tomasz Włostowski 2017-07-02 02:05:42 +02:00
parent 0f5ab1bc87
commit c229063d9e
3 changed files with 18 additions and 0 deletions

View File

@ -263,6 +263,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
}
view->Update ( boardItem );
connectivity->MarkItemNetAsDirty( static_cast<BOARD_ITEM*>( ent.m_copy ) );
connectivity->Update( boardItem );
break;
}

View File

@ -574,3 +574,18 @@ RN_NET* CONNECTIVITY_DATA::GetRatsnestForNet( int aNet )
}
return m_nets[ aNet ];
}
void CONNECTIVITY_DATA::MarkItemNetAsDirty( BOARD_ITEM *aItem )
{
if (aItem->Type() == PCB_MODULE_T)
{
for ( auto pad : static_cast<MODULE*>( aItem )->Pads() )
{
m_connAlgo->MarkNetAsDirty( pad->GetNetCode() );
}
}
if (aItem->IsConnected() )
{
m_connAlgo->MarkNetAsDirty( static_cast<BOARD_CONNECTED_ITEM*>( aItem )->GetNetCode() );
}
}

View File

@ -210,6 +210,8 @@ public:
return m_connAlgo;
}
void MarkItemNetAsDirty( BOARD_ITEM* aItem );
private:
void updateRatsnest();