diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 209ec1ec7c..15970b48d9 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -349,7 +349,9 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( evt->IsMouseDown( BUT_LEFT ) ) { // Avoid triggering when running under other tools - if( m_frame->ToolStackIsEmpty() && !m_toolMgr->GetTool()->HasPoint() ) + EE_POINT_EDITOR *pt_tool = m_toolMgr->GetTool(); + + if( m_frame->ToolStackIsEmpty() && pt_tool && !pt_tool->HasPoint() ) { m_originalCursor = m_toolMgr->GetMousePosition(); m_disambiguateTimer.StartOnce( 500 ); @@ -386,8 +388,10 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) VECTOR2I snappedCursorPos = grid.BestSnapAnchor( evt->Position(), LAYER_CONNECTABLE, nullptr ); + EE_POINT_EDITOR *pt_tool = m_toolMgr->GetTool(); + if( m_frame->eeconfig()->m_Drawing.auto_start_wires - && !m_toolMgr->GetTool()->HasPoint() + && pt_tool && !pt_tool->HasPoint() && collector[0]->IsPointClickableAnchor( (wxPoint) snappedCursorPos ) ) { OPT_TOOL_EVENT newEvt; @@ -622,8 +626,10 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) VECTOR2I snappedCursorPos = grid.BestSnapAnchor( evt->Position(), LAYER_CONNECTABLE, nullptr ); + EE_POINT_EDITOR *pt_tool = m_toolMgr->GetTool(); + if( m_frame->eeconfig()->m_Drawing.auto_start_wires - && !m_toolMgr->GetTool()->HasPoint() + && pt_tool && !pt_tool->HasPoint() && collector[0]->IsPointClickableAnchor( (wxPoint) snappedCursorPos ) ) { SCH_CONNECTION* connection = collector[0]->Connection(); diff --git a/pagelayout_editor/tools/pl_selection_tool.cpp b/pagelayout_editor/tools/pl_selection_tool.cpp index 10bb4e2ec5..ce2a61e1a2 100644 --- a/pagelayout_editor/tools/pl_selection_tool.cpp +++ b/pagelayout_editor/tools/pl_selection_tool.cpp @@ -114,7 +114,9 @@ int PL_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( evt->IsMouseDown( BUT_LEFT ) ) { // Avoid triggering when running under other tools - if( m_frame->ToolStackIsEmpty() && !m_toolMgr->GetTool()->HasPoint() ) + PL_POINT_EDITOR *pt_tool = m_toolMgr->GetTool(); + + if( m_frame->ToolStackIsEmpty() && pt_tool && !pt_tool->HasPoint() ) { m_originalCursor = m_toolMgr->GetMousePosition(); m_disambiguateTimer.StartOnce( 500 ); diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index efabba0430..dbd0e0fe51 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -266,7 +266,9 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) else if( evt->IsMouseDown( BUT_LEFT ) ) { // Avoid triggering when running under other tools - if( m_frame->ToolStackIsEmpty() && !m_toolMgr->GetTool()->HasPoint() ) + PCB_POINT_EDITOR *pt_tool = m_toolMgr->GetTool(); + + if( m_frame->ToolStackIsEmpty() && pt_tool && !pt_tool->HasPoint() ) { m_originalCursor = m_toolMgr->GetMousePosition(); m_disambiguateTimer.StartOnce( 500 );