Clear board soldermask when undoing/redoing items that affect it.

Fixes https://gitlab.com/kicad/code/kicad/issues/13446
This commit is contained in:
Jeff Young 2023-04-15 00:06:33 +01:00
parent d01c023d5a
commit 4a3f77cd9d
1 changed files with 35 additions and 4 deletions

View File

@ -375,6 +375,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
bool not_found = false;
bool reBuild_ratsnest = false;
bool deep_reBuild_ratsnest = false; // true later if pointers must be rebuilt
bool solder_mask_dirty = false;
auto view = GetCanvas()->GetView();
auto connectivity = GetBoard()->GetConnectivity();
@ -445,6 +446,34 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
break;
}
switch( eda_item->Type() )
{
case PCB_FOOTPRINT_T:
solder_mask_dirty = true;
break;
case PCB_VIA_T:
solder_mask_dirty = true;
break;
case PCB_ZONE_T:
case PCB_TRACE_T:
case PCB_ARC_T:
case PCB_PAD_T:
case PCB_SHAPE_T:
{
LSET layers = static_cast<BOARD_ITEM*>( eda_item )->GetLayerSet();
if( layers.test( F_Mask ) || layers.test( B_Mask ) )
solder_mask_dirty = true;
break;
}
default:
break;
}
switch( aList->GetPickedItemStatus( ii ) )
{
case UNDO_REDO::CHANGED: /* Exchange old and new data for each item */
@ -546,11 +575,13 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
if( not_found )
wxMessageBox( _( "Incomplete undo/redo operation: some items not found" ) );
// Rebuild pointers and connectivity that can be changed.
// connectivity can be rebuilt only in the board editor frame
if( IsType( FRAME_PCB_EDITOR ) && ( reBuild_ratsnest || deep_reBuild_ratsnest ) )
if( IsType( FRAME_PCB_EDITOR ) )
{
if( reBuild_ratsnest || deep_reBuild_ratsnest )
Compile_Ratsnest( false );
if( solder_mask_dirty )
HideSolderMask();
}
PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>();