From ac793618f9c452c1299f0d8b1863c4e8862a4c1c Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 20 Dec 2020 11:13:01 -0500 Subject: [PATCH] Set start item for inline dragging so that snapping works properly Fixes https://gitlab.com/kicad/code/kicad/-/issues/6796 --- pcbnew/router/router_tool.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 6a278237c3..7e5021057e 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1500,7 +1500,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) { startItem = m_router->GetWorld()->FindItemByParent( item ); - if( startItem) + if( startItem ) itemsToDrag.Add( startItem ); } @@ -1512,7 +1512,10 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) m_gridHelper->SetSnap( !aEvent.Modifier( MD_SHIFT ) ); if( startItem ) + { p = snapToItem( startItem, p0 ); + m_startItem = startItem; + } int dragMode = aEvent.Parameter ();