From 2b46bda2f29637dac00f0035871a0223d580baca Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 8 May 2018 11:47:14 +0200 Subject: [PATCH] PNS router: apply the last stable state after dragging Previously, dragging changes were applied only if the last cursor move finished with a successful drag operation. It made items squeezing difficult, as it required accurate cursor movement to apply the changes. --- pcbnew/router/pns_dragger.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_dragger.cpp b/pcbnew/router/pns_dragger.cpp index c3dacdb701..0a4c1c81ef 100644 --- a/pcbnew/router/pns_dragger.cpp +++ b/pcbnew/router/pns_dragger.cpp @@ -149,11 +149,13 @@ bool DRAGGER::Start( const VECTOR2I& aP, ITEM* aStartItem ) } } + void DRAGGER::SetMode( int aMode ) { m_mode = aMode; } + bool DRAGGER::dragMarkObstacles( const VECTOR2I& aP ) { if( m_lastNode ) @@ -301,6 +303,7 @@ bool DRAGGER::dragShove( const VECTOR2I& aP ) { if( newVia ) m_draggedVia = newVia; + m_draggedItems.Clear(); } @@ -316,9 +319,11 @@ bool DRAGGER::dragShove( const VECTOR2I& aP ) bool DRAGGER::FixRoute() { - if( m_dragStatus ) + NODE* node = CurrentNode(); + + if( node ) { - Router()->CommitRouting( CurrentNode() ); + Router()->CommitRouting( node ); return true; }