diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 2e521ac8e5..0c7c9b9a1a 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -750,13 +750,16 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia ) // ask the user for a target layer if( selectLayer ) { - wxPoint dlgPosition = wxGetMousePosition(); + wxPoint endPoint = (wxPoint) view()->ToScreen( m_endSnapPoint ); + endPoint = frame()->GetCanvas()->ClientToScreen( endPoint ); + + controls()->WarpCursor( endPoint ); targetLayer = frame()->SelectLayer( static_cast( currentLayer ), - LSET::AllNonCuMask(), dlgPosition ); + LSET::AllNonCuMask(), endPoint ); - // Reset the cursor to the position where the event occurred - controls()->SetCursorPosition( aEvent.HasPosition() ? aEvent.Position() : dlgPosition ); + // Reset the cursor to the end of the track + controls()->SetCursorPosition( m_endSnapPoint ); } }