Repair connectivity if bus aliases changed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16503
This commit is contained in:
Jeff Young 2024-01-30 14:14:00 +00:00
parent b77709bb4d
commit 94cb00392e
1 changed files with 21 additions and 0 deletions

View File

@ -79,6 +79,15 @@ bool SCH_EDIT_FRAME::LoadProjectSettings()
void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
{
SCH_SCREENS screens( Schematic().Root() );
std::vector<std::shared_ptr<BUS_ALIAS>> oldAliases;
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
{
for( const std::shared_ptr<BUS_ALIAS>& alias : screen->GetBusAliases() )
oldAliases.push_back( alias );
}
DIALOG_SCHEMATIC_SETUP dlg( this );
if( !aInitialPage.IsEmpty() )
@ -104,6 +113,18 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
GetCanvas()->GetView()->MarkDirty();
GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
std::vector<std::shared_ptr<BUS_ALIAS>> newAliases;
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
{
for( const std::shared_ptr<BUS_ALIAS>& alias : screen->GetBusAliases() )
newAliases.push_back( alias );
}
if( oldAliases != newAliases )
RecalculateConnections( nullptr, GLOBAL_CLEANUP );
RefreshOperatingPointDisplay();
GetCanvas()->Refresh();
}