More safety when fetching via sizes.
This commit is contained in:
parent
ae26c92a16
commit
81ea71fb80
|
@ -990,8 +990,6 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRulesForItems( DRC_CONSTRAINT_TYPE_T aConstraintI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fixme: return optional<drc_constraint>, let the particular test decide what to do if no matching constraint
|
|
||||||
// is found
|
|
||||||
static DRC_CONSTRAINT nullConstraint( NULL_CONSTRAINT );
|
static DRC_CONSTRAINT nullConstraint( NULL_CONSTRAINT );
|
||||||
nullConstraint.m_DisallowFlags = 0;
|
nullConstraint.m_DisallowFlags = 0;
|
||||||
|
|
||||||
|
|
|
@ -866,6 +866,9 @@ int ROUTER_TOOL::onViaCommand( const TOOL_EVENT& aEvent )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sizes.SetViaDiameter( bds.m_ViasMinSize );
|
||||||
|
sizes.SetViaDrill( bds.m_MinThroughDrill );
|
||||||
|
|
||||||
if( bds.UseNetClassVia() || viaType == VIATYPE::MICROVIA )
|
if( bds.UseNetClassVia() || viaType == VIATYPE::MICROVIA )
|
||||||
{
|
{
|
||||||
class VIA dummyVia( board() );
|
class VIA dummyVia( board() );
|
||||||
|
@ -879,11 +882,15 @@ int ROUTER_TOOL::onViaCommand( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
constraint = bds.m_DRCEngine->EvalRulesForItems( VIA_DIAMETER_CONSTRAINT, &dummyVia,
|
constraint = bds.m_DRCEngine->EvalRulesForItems( VIA_DIAMETER_CONSTRAINT, &dummyVia,
|
||||||
nullptr, currentLayer );
|
nullptr, currentLayer );
|
||||||
sizes.SetViaDiameter( constraint.m_Value.OptThenMin() );
|
|
||||||
|
if( !constraint.IsNull() )
|
||||||
|
sizes.SetViaDiameter( constraint.m_Value.OptThenMin() );
|
||||||
|
|
||||||
constraint = bds.m_DRCEngine->EvalRulesForItems( HOLE_SIZE_CONSTRAINT, &dummyVia, nullptr,
|
constraint = bds.m_DRCEngine->EvalRulesForItems( HOLE_SIZE_CONSTRAINT, &dummyVia, nullptr,
|
||||||
currentLayer );
|
currentLayer );
|
||||||
sizes.SetViaDrill( constraint.m_Value.OptThenMin() );
|
|
||||||
|
if( !constraint.IsNull() )
|
||||||
|
sizes.SetViaDrill( constraint.m_Value.OptThenMin() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue