Browse Source

Only compare collision-corrected routes when looking for shortest.

Fixes https://gitlab.com/kicad/code/kicad/issues/6511
6.0.7
Jeff Young 5 years ago
parent
commit
46314f6483
  1. 5
      pcbnew/router/pns_line_placer.cpp

5
pcbnew/router/pns_line_placer.cpp

@ -477,7 +477,8 @@ bool LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, LINE& aNewHead )
bool LINE_PLACER::rhMarkObstacles( const VECTOR2I& aP, LINE& aNewHead )
{
LINE newHead( m_head ), bestHead( m_head );
LINE newHead( m_head );
LINE bestHead( m_head );
bool hasBest = false;
buildInitialLine( aP, newHead );
@ -503,7 +504,7 @@ bool LINE_PLACER::rhMarkObstacles( const VECTOR2I& aP, LINE& aNewHead )
// We want the shortest line here to ensure we don't break a clearance
// rule on larger, overlapping items (e.g. vias)
if( newHead.CLine().Length() < bestHead.CLine().Length() )
if( !hasBest || newHead.CLine().Length() < bestHead.CLine().Length() )
{
bestHead = newHead;
hasBest = true;

Loading…
Cancel
Save