PNS: keep last valid diff pair trace as current state

This allows fixing/committing what is on screen even if the current
cursor position doesn't have a valid solution (the old behavior
would result in the current trace disappearing)
This commit is contained in:
Jon Evans 2021-04-14 22:43:54 -04:00
parent c829dba88e
commit 268d570941
2 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,7 @@ DIFF_PAIR_PLACER::DIFF_PAIR_PLACER( ROUTER* aRouter ) :
m_snapOnTarget = false;
m_currentEndItem = NULL;
m_currentMode = RM_MarkObstacles;
m_currentTraceOk = false;
m_idle = true;
}
@ -556,6 +557,8 @@ bool DIFF_PAIR_PLACER::Start( const VECTOR2I& aP, ITEM* aStartItem )
m_currentEnd = p;
m_placingVia = false;
m_chainedPlacement = false;
m_currentTraceOk = false;
m_currentTrace = DIFF_PAIR();
initPlacement();
@ -655,6 +658,7 @@ bool DIFF_PAIR_PLACER::routeHead( const VECTOR2I& aP )
if( result )
{
m_currentTraceOk = true;
m_currentTrace.SetNets( m_netP, m_netN );
m_currentTrace.SetWidth( m_sizes.DiffPairWidth() );
m_currentTrace.SetGap( m_sizes.DiffPairGap() );
@ -668,7 +672,7 @@ bool DIFF_PAIR_PLACER::routeHead( const VECTOR2I& aP )
return true;
}
return false;
return m_currentTraceOk;
}

View File

@ -265,6 +265,7 @@ private:
VECTOR2I m_currentEnd, m_currentStart;
DIFF_PAIR m_currentTrace;
bool m_currentTraceOk;
ITEM* m_currentEndItem;
PNS_MODE m_currentMode;