Prevent pads from moving inappropriately

Free pads is a setting unless we are in the footprint editor and needs
to be respected by the alignmen tool

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21626
This commit is contained in:
Seth Hillbrand 2025-09-02 09:10:10 -07:00
parent 0ede830f54
commit 1f1f8699e0

View File

@ -150,6 +150,8 @@ size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( std::vector<std::pair<BOARD_ITEM*,
bool allPads = true;
BOARD_ITEM_CONTAINER* currentParent = nullptr;
bool differentParents = false;
bool allowFreePads = m_selectionTool->IsFootprintEditor()
|| m_frame->GetPcbNewSettings()->m_AllowFreePads;
for( EDA_ITEM* item : selection )
{
@ -192,7 +194,7 @@ size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( std::vector<std::pair<BOARD_ITEM*,
BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
if( allPads && differentParents )
if( boardItem->Type() == PCB_PAD_T && ( !allowFreePads || ( allPads && differentParents ) ) )
{
FOOTPRINT* parentFp = boardItem->GetParentFootprint();