Preserve highlighted connection through a recalculation

This commit is contained in:
Jon Evans 2021-07-03 16:42:14 -04:00
parent 126cd14715
commit 8cbd754362
1 changed files with 10 additions and 0 deletions

View File

@ -1297,6 +1297,13 @@ void SCH_EDIT_FRAME::initScreenZoom()
void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags ) void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags )
{ {
const SCH_CONNECTION* highlight = GetHighlightedConnection();
SCH_ITEM* highlightedItem = highlight ? highlight->Parent() : nullptr;
SCH_SHEET_PATH highlightPath;
if( highlight )
highlightPath = highlight->Sheet();
SCHEMATIC_SETTINGS& settings = Schematic().Settings(); SCHEMATIC_SETTINGS& settings = Schematic().Settings();
SCH_SHEET_LIST list = Schematic().GetSheets(); SCH_SHEET_LIST list = Schematic().GetSheets();
#ifdef PROFILE #ifdef PROFILE
@ -1329,6 +1336,9 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags )
}; };
Schematic().ConnectionGraph()->Recalculate( list, true, &changeHandler ); Schematic().ConnectionGraph()->Recalculate( list, true, &changeHandler );
if( highlightedItem )
SetHighlightedConnection( highlightedItem->Connection( &highlightPath ) );
} }