Rebuilding connectivity must be done after changes are committed.

It also needs to be done after undo and redo.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15028
This commit is contained in:
Jeff Young 2023-06-23 22:10:04 +01:00
parent 237cc7eee1
commit a901247cbd
2 changed files with 8 additions and 5 deletions

View File

@ -214,8 +214,6 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
std::vector<SCH_ITEM*> bulkRemovedItems;
std::vector<SCH_ITEM*> itemsChanged;
frame->RecalculateConnections( this, NO_CLEANUP );
for( COMMIT_LINE& ent : m_changes )
{
int changeType = ent.m_type & CHT_TYPE;
@ -321,6 +319,12 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
}
}
if( frame )
{
frame->RecalculateConnections( this, NO_CLEANUP );
frame->TestDanglingEnds();
}
if( schematic )
{
if( bulkAddedItems.size() > 0 )
@ -347,9 +351,6 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
if( selectedModified )
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
if( frame )
frame->TestDanglingEnds();
if( !( aCommitFlags & SKIP_SET_DIRTY ) )
{
if( frame )

View File

@ -1215,6 +1215,7 @@ int SCH_EDITOR_CONTROL::Undo( const TOOL_EVENT& aEvent )
m_frame->PutDataInPreviousState( undo_list );
m_frame->SetSheetNumberAndCount();
m_frame->RecalculateConnections( nullptr, NO_CLEANUP );
m_frame->TestDanglingEnds();
// Now push the old command to the RedoList
@ -1249,6 +1250,7 @@ int SCH_EDITOR_CONTROL::Redo( const TOOL_EVENT& aEvent )
m_frame->PushCommandToUndoList( list );
m_frame->SetSheetNumberAndCount();
m_frame->RecalculateConnections( nullptr, NO_CLEANUP );
m_frame->TestDanglingEnds();
m_toolMgr->GetTool<EE_SELECTION_TOOL>()->RebuildSelection();