Just because we have a startItem doesn't mean it can find a width.

For instance, a pad with no other tracks attached will return 0.

Fixes https://gitlab.com/kicad/code/kicad/issues/6019
This commit is contained in:
Jeff Young 2020-10-17 13:56:20 +01:00
parent 23d9e2e74a
commit 827699bed2
1 changed files with 4 additions and 2 deletions

View File

@ -366,7 +366,8 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM*
{ {
trackWidth = inheritTrackWidth( aStartItem ); trackWidth = inheritTrackWidth( aStartItem );
} }
else if( bds.UseNetClassTrack() && aStartItem ) // netclass value
if( trackWidth == 0 && bds.UseNetClassTrack() && aStartItem ) // netclass value
{ {
if( m_ruleResolver->QueryConstraint( PNS::CONSTRAINT_TYPE::CT_WIDTH, aStartItem, nullptr, if( m_ruleResolver->QueryConstraint( PNS::CONSTRAINT_TYPE::CT_WIDTH, aStartItem, nullptr,
aStartItem->Layer(), &constraint ) ) aStartItem->Layer(), &constraint ) )
@ -374,7 +375,8 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM*
trackWidth = constraint.m_Value.OptThenMin(); trackWidth = constraint.m_Value.OptThenMin();
} }
} }
else
if( trackWidth == 0 )
{ {
trackWidth = bds.GetCurrentTrackWidth(); trackWidth = bds.GetCurrentTrackWidth();
} }