Browse Source

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

(cherry picked from commit 1f1f8699e0)
9.0
Seth Hillbrand 1 month ago
parent
commit
76ce4ec535
  1. 4
      pcbnew/tools/align_distribute_tool.cpp

4
pcbnew/tools/align_distribute_tool.cpp

@ -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();

Loading…
Cancel
Save