From b0e2aeb972f4f683d79004ca5c250e196bbd117a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 9 Sep 2022 21:41:31 +0100 Subject: [PATCH] Apply the same accuracy band to connectivity as we use for hittesting. Fixes https://gitlab.com/kicad/code/kicad/issues/10745 (cherry picked from commit 9cf3c529d32d37267e143afffc48cf9dd7f3fd23) --- pcbnew/tools/edit_tool.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 2788ae2383..ca3640ec91 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -313,10 +313,12 @@ int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent ) std::shared_ptr c = board->GetConnectivity(); std::vector cItems; + int accuracy = KiROUND( 5 * aCollector.GetGuide()->OnePixelInIU() ); + if( vias.size() == 1 ) { cItems = c->GetConnectedItemsAtAnchor( vias[0], aPt, trackTypes, - vias[0]->GetWidth() / 2 ); + vias[0]->GetWidth() / 2 + accuracy ); if( alg::contains( cItems, tracks[0] ) && alg::contains( cItems, tracks[1] ) ) @@ -328,7 +330,7 @@ int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent ) else if( vias.size() == 0 ) { cItems = c->GetConnectedItemsAtAnchor( tracks[0], aPt, trackTypes, - tracks[0]->GetWidth() / 2 ); + tracks[0]->GetWidth() / 2 + accuracy ); if( alg::contains( cItems, tracks[1] ) ) aCollector.Remove( tracks[1] );