From 2793e67bab8e403fd1f5c21c82190aa5c44eca94 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 30 Sep 2022 16:44:24 +0100 Subject: [PATCH] Bring adding-to-group and hiding in sync. (cherry picked from commit 6a6ef9b1f4a5302a687c1d0c77b58ec13e852192) --- pcbnew/tools/pcb_selection_tool.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index aef4dfa77a..f249acecbb 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2293,7 +2293,10 @@ void PCB_SELECTION_TOOL::unselect( BOARD_ITEM* aItem ) void PCB_SELECTION_TOOL::highlight( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup ) { if( aGroup ) + { aGroup->Add( aItem ); + view()->Hide( aItem, true ); // Hide the original item, so it is shown only on overlay + } highlightInternal( aItem, aMode, aGroup != nullptr ); view()->Update( aItem, KIGFX::REPAINT ); @@ -2312,9 +2315,6 @@ void PCB_SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, bool a else if( aMode == BRIGHTENED ) aItem->SetBrightened(); - if( aUsingOverlay ) - view()->Hide( aItem, true ); // Hide the original item, so it is shown only on overlay - if( aItem->Type() == PCB_FOOTPRINT_T ) { static_cast( aItem )->RunOnChildren( @@ -2337,7 +2337,10 @@ void PCB_SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, bool a void PCB_SELECTION_TOOL::unhighlight( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup ) { if( aGroup ) + { aGroup->Remove( aItem ); + view()->Hide( aItem, false ); // // Restore original item visibility + } unhighlightInternal( aItem, aMode, aGroup != nullptr ); view()->Update( aItem, KIGFX::REPAINT ); @@ -2355,9 +2358,6 @@ void PCB_SELECTION_TOOL::unhighlightInternal( BOARD_ITEM* aItem, int aMode, bool else if( aMode == BRIGHTENED ) aItem->ClearBrightened(); - if( aUsingOverlay ) - view()->Hide( aItem, false ); // // Restore original item visibility - if( aItem->Type() == PCB_FOOTPRINT_T ) { static_cast( aItem )->RunOnChildren(