pcbnew: Allow DRC violations when marked

We shouldn't consider any obstacles when we are routing in DRC violation
mode.

Fixes: lp:1826723
* https://bugs.launchpad.net/kicad/+bug/1826723
This commit is contained in:
Seth Hillbrand 2019-06-09 12:59:37 -07:00
parent 98e68cd66a
commit 3b3165ad51
1 changed files with 16 additions and 12 deletions

View File

@ -436,21 +436,25 @@ bool LINE_PLACER::rhMarkObstacles( const VECTOR2I& aP, LINE& aNewHead )
m_currentNode->QueryColliding( &newHead, obstacles );
for( auto& obs : obstacles )
// If we are allowing DRC violations, we don't push back to the hull
if( !Settings().CanViolateDRC() )
{
int cl = m_currentNode->GetClearance( obs.m_item, &newHead );
auto hull = obs.m_item->Hull( cl, newHead.Width() );
auto nearest = hull.NearestPoint( aP );
Dbg()->AddLine( hull, 2, 10000 );
if( ( nearest - aP ).EuclideanNorm() < newHead.Width() + cl )
for( auto& obs : obstacles )
{
buildInitialLine( nearest, newHead );
if ( newHead.CLine().Length() > bestHead.CLine().Length() )
int cl = m_currentNode->GetClearance( obs.m_item, &newHead );
auto hull = obs.m_item->Hull( cl, newHead.Width() );
auto nearest = hull.NearestPoint( aP );
Dbg()->AddLine( hull, 2, 10000 );
if( ( nearest - aP ).EuclideanNorm() < newHead.Width() + cl )
{
bestHead = newHead;
hasBest = true;
buildInitialLine( nearest, newHead );
if ( newHead.CLine().Length() > bestHead.CLine().Length() )
{
bestHead = newHead;
hasBest = true;
}
}
}
}