PNS: Only run optimization if lastNode is valid
This commit is contained in:
parent
79502a0d88
commit
b5b64a55ad
|
@ -1146,6 +1146,8 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
|
||||||
const SHAPE_LINE_CHAIN& l = pl.CLine();
|
const SHAPE_LINE_CHAIN& l = pl.CLine();
|
||||||
|
|
||||||
if( !l.SegmentCount() )
|
if( !l.SegmentCount() )
|
||||||
|
{
|
||||||
|
if( m_lastNode )
|
||||||
{
|
{
|
||||||
// Do a final optimization to the stored state
|
// Do a final optimization to the stored state
|
||||||
NODE::ITEM_VECTOR removed, added;
|
NODE::ITEM_VECTOR removed, added;
|
||||||
|
@ -1153,6 +1155,7 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
|
||||||
|
|
||||||
if( !added.empty() && added.back()->Kind() == ITEM::SEGMENT_T )
|
if( !added.empty() && added.back()->Kind() == ITEM::SEGMENT_T )
|
||||||
simplifyNewLine( m_lastNode, static_cast<SEGMENT*>( added.back() ) );
|
simplifyNewLine( m_lastNode, static_cast<SEGMENT*>( added.back() ) );
|
||||||
|
}
|
||||||
|
|
||||||
// Nothing to commit if we have an empty line
|
// Nothing to commit if we have an empty line
|
||||||
if( !pl.EndsWithVia() )
|
if( !pl.EndsWithVia() )
|
||||||
|
|
Loading…
Reference in New Issue