Re-route m_last_head after routing fails
This should ensure the shove state gets reverted Fixes https://gitlab.com/kicad/code/kicad/-/issues/9023
This commit is contained in:
parent
1d5db513a1
commit
83305dd407
|
@ -971,9 +971,20 @@ void LINE_PLACER::routeStep( const VECTOR2I& aP )
|
|||
|
||||
if( fail )
|
||||
{
|
||||
PNS_DBG( Dbg(), Message, "routeStep failed" );
|
||||
|
||||
if( m_last_head.PointCount() > 0 )
|
||||
{
|
||||
m_head = m_last_head;
|
||||
PNS_DBG( Dbg(), AddLine, m_head.CLine(), GREEN, 100000, "head-before-re-route" );
|
||||
|
||||
VECTOR2I lastValidRoutePoint = m_head.CPoint( m_head.PointCount() - 1 );
|
||||
|
||||
// Re-route, so the shove state gets reverted
|
||||
if( !routeHead( lastValidRoutePoint, m_head ) )
|
||||
PNS_DBG( Dbg(), Message, "****Unable to recover.***** Route head failed, second time" );
|
||||
|
||||
PNS_DBG( Dbg(), AddLine, m_head.CLine(), GREEN, 100000, "head-after-re-route" );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue