Don't drag multiple coincident vias

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17915


(cherry picked from commit 7a3db2d176)

Co-authored-by: Jon Evans <jon@craftyjon.com>
This commit is contained in:
Jon Evans 2024-05-18 21:51:09 +00:00
parent dfd8aa402d
commit d6a121d617
3 changed files with 10 additions and 1 deletions

View File

@ -196,6 +196,8 @@ const ITEM_SET DRAGGER::findViaFanoutByHandle ( NODE *aNode, const VIA_HANDLE& h
if( !jt )
return rv;
bool foundVia = false;
for( ITEM* item : jt->LinkList() )
{
if( item->OfKind( ITEM::SEGMENT_T | ITEM::ARC_T ) )
@ -211,7 +213,11 @@ const ITEM_SET DRAGGER::findViaFanoutByHandle ( NODE *aNode, const VIA_HANDLE& h
}
else if( item->OfKind( ITEM::VIA_T ) )
{
rv.Add( item );
if( !foundVia )
{
rv.Add( item );
foundVia = true;
}
}
}

View File

@ -142,6 +142,8 @@ int INDEX::Query( const ITEM* aItem, int aMinDistance, Visitor& aVisitor ) const
{
int total = 0;
wxCHECK( aItem->Kind() != ITEM::INVALID_T, 0 );
const LAYER_RANGE& layers = aItem->Layers();
for( int i = layers.Start(); i <= layers.End(); ++i )

View File

@ -99,6 +99,7 @@ public:
///< Supported item types
enum PnsKind
{
INVALID_T = 0,
SOLID_T = 1,
LINE_T = 2,
JOINT_T = 4,