diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index c50a9ce6c1..8ddfbcb32e 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -263,6 +263,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry ) } view->Update ( boardItem ); + connectivity->MarkItemNetAsDirty( static_cast( ent.m_copy ) ); connectivity->Update( boardItem ); break; } diff --git a/pcbnew/connectivity.cpp b/pcbnew/connectivity.cpp index 750f84ffe6..b1e510a30b 100644 --- a/pcbnew/connectivity.cpp +++ b/pcbnew/connectivity.cpp @@ -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( aItem )->Pads() ) + { + m_connAlgo->MarkNetAsDirty( pad->GetNetCode() ); + } + } + if (aItem->IsConnected() ) + { + m_connAlgo->MarkNetAsDirty( static_cast( aItem )->GetNetCode() ); + } +} diff --git a/pcbnew/connectivity.h b/pcbnew/connectivity.h index 803a3b871c..bcd5cfa491 100644 --- a/pcbnew/connectivity.h +++ b/pcbnew/connectivity.h @@ -210,6 +210,8 @@ public: return m_connAlgo; } + void MarkItemNetAsDirty( BOARD_ITEM* aItem ); + private: void updateRatsnest();