Browse Source

Fix alignment tool with locked footprints

6.0.7
Seth Hillbrand 5 years ago
parent
commit
51f02ecc51
  1. 16
      pcbnew/tools/placement_tool.cpp

16
pcbnew/tools/placement_tool.cpp

@ -66,7 +66,7 @@ bool ALIGN_DISTRIBUTE_TOOL::Init()
m_placementMenu->Add( PCB_ACTIONS::alignLeft );
m_placementMenu->Add( PCB_ACTIONS::alignCenterX );
m_placementMenu->Add( PCB_ACTIONS::alignRight );
m_placementMenu->AppendSeparator();
m_placementMenu->Add( PCB_ACTIONS::alignTop );
m_placementMenu->Add( PCB_ACTIONS::alignCenterY );
@ -162,7 +162,19 @@ size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( ALIGNMENT_RECTS& aItemsToAlign,
BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
if( boardItem->IsLocked() )
lockedItems.push_back( boardItem );
{
// Locking a pad but not the footprint means that we align the footprint using
// the pad position. So we test for footprint locking here
if( m_frame->IsType( FRAME_PCB_EDITOR ) && boardItem->Type() == PCB_PAD_T
&& !boardItem->GetParent()->IsLocked() )
{
itemsToAlign.push_back( boardItem );
}
else
{
lockedItems.push_back( boardItem );
}
}
else
itemsToAlign.push_back( boardItem );
}

Loading…
Cancel
Save