From 3c87e67753ad3d7a559482136e97934e7d1a8898 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 27 Dec 2020 17:14:38 -0500 Subject: [PATCH] PNS: Allow committing routes even when cursor moves beyond valid solution Fixes https://gitlab.com/kicad/code/kicad/-/issues/6651 --- pcbnew/router/pns_dragger.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_dragger.cpp b/pcbnew/router/pns_dragger.cpp index 1e4a46e96a..417063f6fe 100644 --- a/pcbnew/router/pns_dragger.cpp +++ b/pcbnew/router/pns_dragger.cpp @@ -530,9 +530,23 @@ bool DRAGGER::FixRoute() if( node ) { - // Collisions still prevent fixing unless "Allow DRC violations" is checked + // If collisions exist, we can fix in shove/smart mode because all tracks to be committed + // will be in valid positions (even if the current routing solution to the mouse cursor is + // invalid). In other modes, we can only commit if "Allow DRC violations" is enabled. if( !m_dragStatus ) - return false; + { + switch( m_currentMode ) + { + case RM_Shove: + case RM_Smart: + break; + + case RM_Walkaround: + default: + if( !Settings().CanViolateDRC() ) + return false; + } + } Router()->CommitRouting( node ); return true;