Try to reconcile SELECTION and BRIGHTENED use of overlay.
For some reason the overlay doesn't get redrawn during the PCBNew selection disambiguation menu, so we need to not hide BRIGHTENED items. Fixes https://gitlab.com/kicad/code/kicad/issues/12547
This commit is contained in:
parent
120b569048
commit
436d75e7f9
|
@ -2578,10 +2578,7 @@ void PCB_SELECTION_TOOL::unselect( EDA_ITEM* aItem )
|
||||||
void PCB_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
|
void PCB_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
|
||||||
{
|
{
|
||||||
if( aGroup )
|
if( aGroup )
|
||||||
{
|
|
||||||
aGroup->Add( aItem );
|
aGroup->Add( aItem );
|
||||||
view()->Hide( aItem, true ); // Hide the original item, so it is shown only on overlay
|
|
||||||
}
|
|
||||||
|
|
||||||
highlightInternal( aItem, aMode, aGroup != nullptr );
|
highlightInternal( aItem, aMode, aGroup != nullptr );
|
||||||
view()->Update( aItem, KIGFX::REPAINT );
|
view()->Update( aItem, KIGFX::REPAINT );
|
||||||
|
@ -2600,6 +2597,9 @@ void PCB_SELECTION_TOOL::highlightInternal( EDA_ITEM* aItem, int aMode, bool aUs
|
||||||
else if( aMode == BRIGHTENED )
|
else if( aMode == BRIGHTENED )
|
||||||
aItem->SetBrightened();
|
aItem->SetBrightened();
|
||||||
|
|
||||||
|
if( aUsingOverlay && aMode != BRIGHTENED )
|
||||||
|
view()->Hide( aItem, true ); // Hide the original item, so it is shown only on overlay
|
||||||
|
|
||||||
if( aItem->Type() == PCB_FOOTPRINT_T )
|
if( aItem->Type() == PCB_FOOTPRINT_T )
|
||||||
{
|
{
|
||||||
static_cast<FOOTPRINT*>( aItem )->RunOnChildren(
|
static_cast<FOOTPRINT*>( aItem )->RunOnChildren(
|
||||||
|
@ -2622,10 +2622,7 @@ void PCB_SELECTION_TOOL::highlightInternal( EDA_ITEM* aItem, int aMode, bool aUs
|
||||||
void PCB_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
|
void PCB_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
|
||||||
{
|
{
|
||||||
if( aGroup )
|
if( aGroup )
|
||||||
{
|
|
||||||
aGroup->Remove( aItem );
|
aGroup->Remove( aItem );
|
||||||
view()->Hide( aItem, false ); // // Restore original item visibility
|
|
||||||
}
|
|
||||||
|
|
||||||
unhighlightInternal( aItem, aMode, aGroup != nullptr );
|
unhighlightInternal( aItem, aMode, aGroup != nullptr );
|
||||||
view()->Update( aItem, KIGFX::REPAINT );
|
view()->Update( aItem, KIGFX::REPAINT );
|
||||||
|
@ -2643,6 +2640,9 @@ void PCB_SELECTION_TOOL::unhighlightInternal( EDA_ITEM* aItem, int aMode, bool a
|
||||||
else if( aMode == BRIGHTENED )
|
else if( aMode == BRIGHTENED )
|
||||||
aItem->ClearBrightened();
|
aItem->ClearBrightened();
|
||||||
|
|
||||||
|
if( aUsingOverlay && aMode != BRIGHTENED )
|
||||||
|
view()->Hide( aItem, false ); // // Restore original item visibility
|
||||||
|
|
||||||
if( aItem->Type() == PCB_FOOTPRINT_T )
|
if( aItem->Type() == PCB_FOOTPRINT_T )
|
||||||
{
|
{
|
||||||
static_cast<FOOTPRINT*>( aItem )->RunOnChildren(
|
static_cast<FOOTPRINT*>( aItem )->RunOnChildren(
|
||||||
|
|
Loading…
Reference in New Issue