Only clear link when adding footprint from library, cache, etc.

Fixes: lp:1792256
* https://bugs.launchpad.net/kicad/+bug/1792256
This commit is contained in:
Jeff Young 2018-10-01 19:18:25 +01:00
parent db5386467b
commit dfe164e0dc
3 changed files with 2 additions and 1 deletions

View File

@ -369,6 +369,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
if( module ) if( module )
{ {
m_canvas->MoveCursorToCrossHair(); m_canvas->MoveCursorToCrossHair();
module->SetLink( 0 );
AddModuleToBoard( module ); AddModuleToBoard( module );
if( aDC ) if( aDC )

View File

@ -219,7 +219,6 @@ void PCB_BASE_FRAME::AddModuleToBoard( MODULE* module )
GetBoard()->Add( module, ADD_APPEND ); GetBoard()->Add( module, ADD_APPEND );
module->SetFlags( IS_NEW ); module->SetFlags( IS_NEW );
module->SetLink( 0 );
if( IsGalCanvasActive() ) if( IsGalCanvasActive() )
module->SetPosition( wxPoint( 0, 0 ) ); // cursor in GAL may not be initialized at the moment module->SetPosition( wxPoint( 0, 0 ) ); // cursor in GAL may not be initialized at the moment

View File

@ -474,6 +474,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
if( module == NULL ) if( module == NULL )
continue; continue;
module->SetLink( 0 );
m_frame->AddModuleToBoard( module ); m_frame->AddModuleToBoard( module );
commit.Added( module ); commit.Added( module );
module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) ); module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );