From 0e7c18119ecb102b3779c0e48956210b71845426 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 26 Jan 2021 14:55:38 +0000 Subject: [PATCH] Make sure pads are unlocked when editing footprint from board. Fixes https://gitlab.com/kicad/code/kicad/issues/7274 --- include/eda_item.h | 1 + pcbnew/load_select_footprint.cpp | 3 +++ pcbnew/pcb_base_frame.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/eda_item.h b/include/eda_item.h index 8919e10fb5..268f0cc7b7 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -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) diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 1602bdd328..42e0faf3ea 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -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(); } ); diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 2c271a2e0e..f65d557059 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -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