diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 78b82fcbfa..ca78c74ba3 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -278,9 +278,7 @@ void TOOL_BASE::updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads ) m_startItem = nullptr; m_startSnapPoint = snapToItem( m_startItem, p ); - - if( checkSnap( m_startItem ) ) - controls()->ForceCursorPosition( true, m_startSnapPoint ); + controls()->ForceCursorPosition( true, m_startSnapPoint ); } diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 8e8da794d1..8dedbf95a3 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1020,7 +1020,6 @@ bool ROUTER_TOOL::prepareInteractive() if( m_startItem && m_startItem->Net() > 0 ) highlightNet( true, m_startItem->Net() ); - controls()->ForceCursorPosition( false ); controls()->SetAutoPan( true ); PNS::SIZES_SETTINGS sizes( m_router->Sizes() ); @@ -1653,7 +1652,6 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) m_gridHelper->SetAuxAxes( true, p ); controls()->ShowCursor( true ); - controls()->ForceCursorPosition( false ); controls()->SetAutoPan( true ); frame()->UndoRedoBlock( true ); diff --git a/pcbnew/tools/pcb_grid_helper.cpp b/pcbnew/tools/pcb_grid_helper.cpp index 91fab8957b..84ef5c07b0 100644 --- a/pcbnew/tools/pcb_grid_helper.cpp +++ b/pcbnew/tools/pcb_grid_helper.cpp @@ -84,11 +84,7 @@ VECTOR2I PCB_GRID_HELPER::AlignToSegment( const VECTOR2I& aPoint, const SEG& aSe if( !m_enableSnap ) return aPoint; - const VECTOR2D gridOffset( GetOrigin() ); - const VECTOR2D gridSize( GetGrid() ); - - VECTOR2I nearest( KiROUND( ( aPoint.x - gridOffset.x ) / gridSize.x ) * gridSize.x + gridOffset.x, - KiROUND( ( aPoint.y - gridOffset.y ) / gridSize.y ) * gridSize.y + gridOffset.y ); + VECTOR2I nearest = Align( aPoint ); pts[0] = aSeg.A; pts[1] = aSeg.B; @@ -202,7 +198,9 @@ VECTOR2I PCB_GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, BOARD_ITEM* a item.push_back( aReferenceItem ); } else + { layers = LSET::AllLayersMask(); + } return BestSnapAnchor( aOrigin, layers, item ); }