From 4207165c267c6f6f68030343f5eb31317bf84fe5 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Wed, 7 Jul 2021 19:54:19 +0100 Subject: [PATCH] Fix PNS deleting too many segments Don't exit the loop pre-emptively. Need to update lastLink. --- pcbnew/router/pns_line.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp index f35d0691cc..7b1fefcff0 100644 --- a/pcbnew/router/pns_line.cpp +++ b/pcbnew/router/pns_line.cpp @@ -1084,12 +1084,12 @@ void LINE::ClipVertexRange( int aStart, int aEnd ) int numPoints = static_cast( m_line.PointCount() ); - for( int i = 0; i >= 0 && i < m_line.PointCount(); i = m_line.NextShape( i ) ) + for( int i = 0; i < m_line.PointCount(); i = m_line.NextShape( i ) ) { if( i <= aStart ) firstLink = linkIdx; - if( i == -1 || i >= aEnd - 1 || linkIdx >= lastLink ) + if( i < 0 || i >= aEnd - 1 || linkIdx >= lastLink ) { lastLink = linkIdx; break;