7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 16:23:44 +00:00

router: fix regression in simplifyNewLine() causing unnecessary segments to be added to board (forming loops)

(note to self: OPTIMIZER now unlinks the in-place-optimized LINEs)
This commit is contained in:
Tomasz Wlostowski 2025-01-10 14:45:35 +01:00
parent 3b035c279d
commit bf64e74188

View File

@ -1913,7 +1913,8 @@ void LINE_PLACER::simplifyNewLine( NODE* aNode, LINKED_ITEM* aLatest )
// And now we can proceed with assembling the final line and optimizing it.
LINE l = aNode->AssembleLine( aLatest );
LINE l_orig = aNode->AssembleLine( aLatest );
LINE l( l_orig );
bool optimized = OPTIMIZER::Optimize( &l, OPTIMIZER::MERGE_COLINEAR, aNode );
@ -1923,9 +1924,10 @@ void LINE_PLACER::simplifyNewLine( NODE* aNode, LINKED_ITEM* aLatest )
if( optimized || simplified.PointCount() != l.PointCount() )
{
aNode->Remove( l );
aNode->Remove( l_orig );
l.SetShape( simplified );
aNode->Add( l );
PNS_DBG( Dbg(), AddItem, &l, RED, 100000, wxT("simplified"));
}
}