PNS: Keep most recent good placement around for a rainy day

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8562
This commit is contained in:
Jon Evans 2021-06-06 18:56:33 -04:00
parent e42f4a8f70
commit 6789dac20b
2 changed files with 15 additions and 2 deletions

View File

@ -960,8 +960,19 @@ void LINE_PLACER::routeStep( const VECTOR2I& aP )
if( fail )
{
m_head.RemoveVia();
m_head.Clear();
if( m_last_head.PointCount() > 0 )
{
m_head = m_last_head;
}
else
{
m_head.RemoveVia();
m_head.Clear();
}
}
else
{
m_last_head = m_head;
}
if( !fail && Settings().FollowMouse() )

View File

@ -328,6 +328,8 @@ private:
LINE m_head; ///< the volatile part of the track from the previously
///< analyzed point to the current routing destination
LINE m_last_head; ///< Most recent successful (non-colliding) head
LINE m_tail; ///< routing "tail": part of the track that has been already
///< fixed due to collisions with obstacles