Make global delete tracks remove tuning patterns

If we are removing the generated item, we should remove the generator as
well

Fixes https://gitlab.com/kicad/code/kicad/issues/21572
This commit is contained in:
Seth Hillbrand 2025-09-09 13:05:55 -07:00
parent d356073798
commit cb4c8e6647
2 changed files with 12 additions and 0 deletions

View File

@ -31,7 +31,9 @@ using namespace std::placeholders;
#include <board_commit.h>
#include <board.h>
#include <footprint.h>
#include <pcb_generator.h>
#include <pcb_track.h>
#include <generators/pcb_tuning_pattern.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/global_edit_tool.h>
@ -272,6 +274,15 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions()
}
}
}
for( PCB_GENERATOR* generator : board->Generators() )
{
if( PCB_TUNING_PATTERN* pattern = dynamic_cast<PCB_TUNING_PATTERN*>( generator ) )
{
if( pattern->GetBoardItems().empty() )
commit.Remove( pattern );
}
}
}
commit.Push( _( "Global Delete" ) );

View File

@ -23,6 +23,7 @@
*/
#include <eda_item.h>
#include <geometry/geometry_utils.h>
#include <pcb_base_edit_frame.h>
#include <router/pns_meander.h>
#include <router/pns_meander_placer_base.h>