Apply the same accuracy band to connectivity as we use for hittesting.

Fixes https://gitlab.com/kicad/code/kicad/issues/10745
This commit is contained in:
Jeff Young 2022-09-09 21:41:31 +01:00
parent 93670d2b24
commit 9cf3c529d3
1 changed files with 4 additions and 2 deletions

View File

@ -338,11 +338,13 @@ int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent )
std::shared_ptr<CONNECTIVITY_DATA> c = board->GetConnectivity();
std::vector<BOARD_CONNECTED_ITEM*> cItems;
int accuracy = KiROUND( 5 * aCollector.GetGuide()->OnePixelInIU() );
if( vias.size() == 1 )
{
cItems = c->GetConnectedItemsAtAnchor( vias[0], aPt,
{ PCB_TRACE_T, PCB_ARC_T },
vias[0]->GetWidth() / 2 );
vias[0]->GetWidth() / 2 + accuracy );
if( alg::contains( cItems, tracks[0] )
&& alg::contains( cItems, tracks[1] ) )
@ -355,7 +357,7 @@ int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent )
{
cItems = c->GetConnectedItemsAtAnchor( tracks[0], aPt,
{ PCB_TRACE_T, PCB_ARC_T },
tracks[0]->GetWidth() / 2 );
tracks[0]->GetWidth() / 2 + accuracy );
if( alg::contains( cItems, tracks[1] ) )
aCollector.Remove( tracks[1] );