From 21969595399a1629202371909f17ba5ae8f3a1d8 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 15 Sep 2018 20:18:59 -0700 Subject: [PATCH] pcbnew: Fix dragging snap to items Snapping while dragging depends on the current net being assigned during dragging. This initializes the placer to hold the current net while performing inline dragging. The placer is reset along with the dragger in StopRouting(). This fixes the difference in snap between drag and create new route. --- pcbnew/router/pns_router.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index 5c6e25b84f..7846650fc2 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -135,6 +135,9 @@ bool ROUTER::StartDragging( const VECTOR2I& aP, ITEM* aStartItem, int aDragMode if( !aStartItem || aStartItem->OfKind( ITEM::SOLID_T ) ) return false; + m_placer.reset( new LINE_PLACER( this ) ); + m_placer->Start( aP, aStartItem ); + m_dragger.reset( new DRAGGER( this ) ); m_dragger->SetMode( aDragMode ); m_dragger->SetWorld( m_world.get() );