From dfe164e0dc6ba37cfbe66df52fb84ff245dcf153 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 1 Oct 2018 19:18:25 +0100 Subject: [PATCH] Only clear link when adding footprint from library, cache, etc. Fixes: lp:1792256 * https://bugs.launchpad.net/kicad/+bug/1792256 --- pcbnew/onleftclick.cpp | 1 + pcbnew/pcb_base_frame.cpp | 1 - pcbnew/tools/pcb_editor_control.cpp | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index 8b5442e81c..799be3a675 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -369,6 +369,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) if( module ) { m_canvas->MoveCursorToCrossHair(); + module->SetLink( 0 ); AddModuleToBoard( module ); if( aDC ) diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 27766d5e79..af181bd1ef 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -219,7 +219,6 @@ void PCB_BASE_FRAME::AddModuleToBoard( MODULE* module ) GetBoard()->Add( module, ADD_APPEND ); module->SetFlags( IS_NEW ); - module->SetLink( 0 ); if( IsGalCanvasActive() ) module->SetPosition( wxPoint( 0, 0 ) ); // cursor in GAL may not be initialized at the moment diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index 997ee580fc..62639d135c 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -474,6 +474,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) if( module == NULL ) continue; + module->SetLink( 0 ); m_frame->AddModuleToBoard( module ); commit.Added( module ); module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );