From 8cbd754362cdc893bb585c338d16d1a4baed14b8 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 3 Jul 2021 16:42:14 -0400 Subject: [PATCH] Preserve highlighted connection through a recalculation --- eeschema/sch_edit_frame.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 4f3a702cad..cd07dcb3c4 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1297,6 +1297,13 @@ void SCH_EDIT_FRAME::initScreenZoom() 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(); SCH_SHEET_LIST list = Schematic().GetSheets(); #ifdef PROFILE @@ -1329,6 +1336,9 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags ) }; Schematic().ConnectionGraph()->Recalculate( list, true, &changeHandler ); + + if( highlightedItem ) + SetHighlightedConnection( highlightedItem->Connection( &highlightPath ) ); }