diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index caf42d9082..246505db2d 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -321,9 +321,6 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) EE_GRID_HELPER grid( m_toolMgr ); - VECTOR2I rawPos = evt->IsPrime() ? evt->Position() : getViewControls()->GetMousePosition(); - VECTOR2I cursorPos = grid.BestSnapAnchor( rawPos, nullptr ); - // Single click? Select single object if( evt->IsClick( BUT_LEFT ) ) { @@ -341,8 +338,10 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( collector.GetCount() == 1 ) { // Check if we want to auto start wires + VECTOR2I snappedCursorPos = grid.BestSnapAnchor( evt->Position(), nullptr ); + if( m_frame->eeconfig()->m_Drawing.auto_start_wires - && collector[0]->IsPointClickableAnchor( (wxPoint) cursorPos ) ) + && collector[0]->IsPointClickableAnchor( (wxPoint) snappedCursorPos ) ) { OPT_TOOL_EVENT newEvt = EE_ACTIONS::drawWire.MakeEvent(); auto* params = newEvt->Parameter(); @@ -507,8 +506,10 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( collector.GetCount() == 1 ) { + VECTOR2I snappedCursorPos = grid.BestSnapAnchor( evt->Position(), nullptr ); + if( m_frame->eeconfig()->m_Drawing.auto_start_wires - && collector[0]->IsPointClickableAnchor( (wxPoint) cursorPos ) ) + && collector[0]->IsPointClickableAnchor( (wxPoint) snappedCursorPos ) ) { displayPencil = true; }