From 63718323bcaaf5220ce1522b9d47cc1c733246a1 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 25 Nov 2021 15:31:18 -0500 Subject: [PATCH] PNS: Holes need to be moved with solids Fixes https://gitlab.com/kicad/code/kicad/-/issues/9773 --- pcbnew/router/pns_component_dragger.cpp | 10 +++++++--- pcbnew/router/pns_solid.cpp | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pcbnew/router/pns_component_dragger.cpp b/pcbnew/router/pns_component_dragger.cpp index 7138f569ea..b5ea99bc88 100644 --- a/pcbnew/router/pns_component_dragger.cpp +++ b/pcbnew/router/pns_component_dragger.cpp @@ -117,14 +117,15 @@ bool COMPONENT_DRAGGER::Start( const VECTOR2I& aP, ITEM_SET& aPrimitives ) if( item.item->Kind() != ITEM::SOLID_T ) continue; - auto solid = static_cast( item.item ); - auto jt = m_world->FindJoint( solid->Pos(), solid ); + SOLID* solid = static_cast( item.item ); m_solids.insert( solid ); - if( ! item.item->IsRoutable() ) + if( !item.item->IsRoutable() ) continue; + JOINT* jt = m_world->FindJoint( solid->Pos(), solid ); + for( auto link : jt->LinkList() ) { if( link.item->OfKind( ITEM::SEGMENT_T | ITEM::ARC_T ) ) @@ -174,6 +175,9 @@ bool COMPONENT_DRAGGER::Drag( const VECTOR2I& aP ) m_draggedItems.Add( snew.get() ); m_currentNode->Add( std::move( snew ) ); + if( !s->IsRoutable() ) + continue; + for( auto& l : m_conns ) { if( l.attachedPad == s ) diff --git a/pcbnew/router/pns_solid.cpp b/pcbnew/router/pns_solid.cpp index 4dc357be5d..d11565dd67 100644 --- a/pcbnew/router/pns_solid.cpp +++ b/pcbnew/router/pns_solid.cpp @@ -165,6 +165,9 @@ void SOLID::SetPos( const VECTOR2I& aCenter ) if( m_shape ) m_shape->Move( delta ); + if( m_hole ) + m_hole->Move( delta ); + m_pos = aCenter; }