Do not prune items/layers when copying the clipboard to the FP editor: all are allowed

(Some are disabled only for GUI)
Fixes #13334
https://gitlab.com/kicad/code/kicad/issues/13334
This commit is contained in:
jean-pierre charras 2023-01-01 13:35:05 +01:00
parent 339a349a58
commit 1b1586696f
1 changed files with 8 additions and 0 deletions

View File

@ -731,6 +731,13 @@ static void pasteFootprintItemsToFootprintEditor( FOOTPRINT* aClipFootprint, BOA
void PCB_CONTROL::pruneItemLayers( std::vector<BOARD_ITEM*>& aItems )
{
// Do not prune items or layers when copying to the FP editor, because all
// layers are accepted, even if they are not enabled in the dummy board
// This is mainly true for internal copper layers: all are allowed but only one
// (In1.cu) is enabled for the GUI.
if( m_isFootprintEditor || frame()->IsType( FRAME_FOOTPRINT_EDITOR ) )
return;
LSET enabledLayers = board()->GetEnabledLayers();
std::vector<BOARD_ITEM*> returnItems;
bool fpItemDeleted = false;
@ -753,6 +760,7 @@ void PCB_CONTROL::pruneItemLayers( std::vector<BOARD_ITEM*>& aItems )
for( BOARD_ITEM* item : aItems )
{
if( item->Type() == PCB_FOOTPRINT_T )
{
FOOTPRINT* fp = static_cast<FOOTPRINT*>( item );