Browse Source

Don't leave temp footprints attached to a board.

7.0
Jeff Young 3 years ago
parent
commit
f45d44a639
  1. 2
      pcbnew/footprint.cpp
  2. 4
      pcbnew/kicad_clipboard.cpp
  3. 9
      pcbnew/tools/footprint_editor_control.cpp

2
pcbnew/footprint.cpp

@ -795,6 +795,8 @@ BOX2I FOOTPRINT::GetFpPadsLocalBbox() const
for( PAD* pad : dummy.Pads() )
bbox.Merge( pad->GetBoundingBox() );
dummy.SetParent( nullptr );
return bbox;
}

4
pcbnew/kicad_clipboard.cpp

@ -94,6 +94,8 @@ void CLIPBOARD_IO::SaveSelection( const PCB_SELECTION& aSelected, bool isFootpri
newFootprint.Move( VECTOR2I( -refPoint.x, -refPoint.y ) );
Format( static_cast<BOARD_ITEM*>( &newFootprint ) );
newFootprint.SetParent( nullptr );
}
else if( isFootprintEditor )
{
@ -171,6 +173,8 @@ void CLIPBOARD_IO::SaveSelection( const PCB_SELECTION& aSelected, bool isFootpri
partialFootprint.MoveAnchorPosition( moveVector );
Format( &partialFootprint, 0 );
partialFootprint.SetParent( nullptr );
}
else
{

9
pcbnew/tools/footprint_editor_control.cpp

@ -44,6 +44,8 @@
#include <kiway.h>
#include <drc/drc_item.h>
#include <memory>
FOOTPRINT_EDITOR_CONTROL::FOOTPRINT_EDITOR_CONTROL() :
PCB_TOOL_BASE( "pcbnew.ModuleEditor" ),
@ -326,9 +328,14 @@ int FOOTPRINT_EDITOR_CONTROL::CutCopyFootprint( const TOOL_EVENT& aEvent )
LIB_ID fpID = m_frame->GetTreeFPID();
if( fpID == m_frame->GetLoadedFPID() )
m_copiedFootprint.reset( new FOOTPRINT( *m_frame->GetBoard()->GetFirstFootprint() ) );
{
m_copiedFootprint = std::make_unique<FOOTPRINT>( *m_frame->GetBoard()->GetFirstFootprint() );
m_copiedFootprint->SetParent( nullptr );
}
else
{
m_copiedFootprint.reset( m_frame->LoadFootprint( fpID ) );
}
if( aEvent.IsAction( &PCB_ACTIONS::cutFootprint ) )
DeleteFootprint( aEvent );

Loading…
Cancel
Save