Make sure pads are unlocked when editing footprint from board.

Fixes https://gitlab.com/kicad/code/kicad/issues/7274
This commit is contained in:
Jeff Young 2021-01-26 14:55:38 +00:00
parent 2e58826338
commit 0e7c18119e
3 changed files with 5 additions and 1 deletions

View File

@ -118,6 +118,7 @@ typedef const INSPECTOR_FUNC& INSPECTOR;
#define DO_NOT_DRAW (1 << 16) ///< Used to disable draw function
#define IS_PASTED (1 << 17) ///< Modifier on IS_NEW which indicates it came from clipboard
#define LOCKED (1 << 18) ///< Pcbnew: locked from movement and deletion
///< NB: stored in m_status flags, NOT m_flags.
#define UNUSED (1 << 19)
#define MALFORMED_F_COURTYARD (1 << 20)
#define MALFORMED_B_COURTYARD (1 << 21)

View File

@ -113,6 +113,9 @@ bool FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard( FOOTPRINT* aFootprint )
newFootprint->ClearFlags();
newFootprint->RunOnChildren( []( BOARD_ITEM* aItem )
{
if( aItem->Type() == PCB_PAD_T )
aItem->SetLocked( false );
aItem->ClearFlags();
} );

View File

@ -160,7 +160,7 @@ void PCB_BASE_FRAME::AddFootprintToBoard( FOOTPRINT* aFootprint )
{
GetBoard()->Add( aFootprint, ADD_MODE::APPEND );
aFootprint->SetFlags(IS_NEW );
aFootprint->SetFlags( IS_NEW );
aFootprint->SetPosition( wxPoint( 0, 0 ) ); // cursor in GAL may not be initialized yet
// Put it on FRONT layer (note that it might be stored flipped if the lib is an archive