diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp index 6efcc73eec..cb02b474d8 100644 --- a/eeschema/onleftclick.cpp +++ b/eeschema/onleftclick.cpp @@ -287,6 +287,8 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) case ID_SCH_PLACE_COMPONENT: if( (item == NULL) || (item->GetFlags() == 0) ) { + // ERC dialog interferes with moving items so we close it before starting + CloseErc(); GetScreen()->SetCurItem( Load_Component( aDC, NULL, s_CmpNameList, true ) ); m_canvas->SetAutoPanRequest( true ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 207fdb6052..b13d2b839e 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -846,6 +846,16 @@ void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event ) } +void SCH_EDIT_FRAME::CloseErc() +{ + // Find the ERC dialog if it's open and close it + wxWindow* erc = FindWindowById( ID_DIALOG_ERC, this ); + + if( erc ) + erc->Close( false ); +} + + void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event ) { doUpdatePcb( "" ); diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index fc130c6bac..1d21a632a4 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -922,6 +922,11 @@ private: void OnUpdateHierarchySheet( wxUpdateUIEvent& aEvent ); void OnUpdateRemapSymbols( wxUpdateUIEvent& aEvent ); + /** + * Close the ERC dialog if it is open. + */ + void CloseErc(); + /** * Set the main window title bar text. *