Go back to using VIEW::Hide() instead of ForcedTransparency().

(The issue was that the selection VIEW_GROUP drawing ignores the
HIDDEN flag so we need to make sure the PCB_GENERATOR_MEANDERS isn't
in the selection VIEW_GROUP while we're editing it.)
This commit is contained in:
Jeff Young 2023-10-12 00:30:16 +01:00
parent 1b676985f6
commit d4b8b550f3
1 changed files with 7 additions and 4 deletions

View File

@ -303,6 +303,11 @@ public:
aCommit->Modify( this ); aCommit->Modify( this );
} }
// Remove ourselves from the selection so that we don't redraw our existing children as
// part of the selection VIEW_GROUP (which ignores the HIDDEN flags).
PCB_SELECTION_TOOL*selectionTool = aFrame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
selectionTool->RemoveItemFromSel( this, true );
int layer = GetLayer(); int layer = GetLayer();
PNS::ROUTER* router = aTool->Router(); PNS::ROUTER* router = aTool->Router();
@ -659,8 +664,7 @@ public:
{ {
if( li->Parent() ) if( li->Parent() )
{ {
li->Parent()->SetForcedTransparency( 1.0 ); aFrame->GetCanvas()->GetView()->Hide( li->Parent() );
aFrame->GetCanvas()->GetView()->Update( li->Parent() );
m_removedItems.insert( li->Parent() ); m_removedItems.insert( li->Parent() );
} }
} }
@ -736,7 +740,6 @@ public:
for( BOARD_ITEM* item : m_removedItems ) for( BOARD_ITEM* item : m_removedItems )
{ {
item->SetForcedTransparency( 0.0 );
aCommit->Remove( item ); aCommit->Remove( item );
} }
@ -765,7 +768,7 @@ public:
BOARD_COMMIT* aCommit ) override BOARD_COMMIT* aCommit ) override
{ {
for( BOARD_ITEM* item : m_removedItems ) for( BOARD_ITEM* item : m_removedItems )
item->SetForcedTransparency( 0.0 ); aFrame->GetCanvas()->GetView()->Hide( item, false );
m_removedItems.clear(); m_removedItems.clear();