Process rules in "natural" order using overrides.
(We used to process in reverse order with first-match-wins, but that doesn't allow min, max and opt to come from different rules.) Fixes https://gitlab.com/kicad/code/kicad/issues/9004
This commit is contained in:
parent
048e13f423
commit
3e57700b21
|
@ -1093,23 +1093,8 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
|||
{
|
||||
std::vector<DRC_ENGINE_CONSTRAINT*>* ruleset = m_constraintMap[ aConstraintType ];
|
||||
|
||||
if( aReporter )
|
||||
{
|
||||
// We want to see all results so process in "natural" order
|
||||
for( int ii = 0; ii < (int) ruleset->size(); ++ii )
|
||||
{
|
||||
processConstraint( ruleset->at( ii ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Last matching rule wins, so process in reverse order and quit when match found
|
||||
for( int ii = (int) ruleset->size() - 1; ii >= 0; --ii )
|
||||
{
|
||||
if( processConstraint( ruleset->at( ii ) ) )
|
||||
break;
|
||||
}
|
||||
}
|
||||
for( int ii = 0; ii < (int) ruleset->size(); ++ii )
|
||||
processConstraint( ruleset->at( ii ) );
|
||||
}
|
||||
|
||||
if( constraint.GetParentRule() && !constraint.GetParentRule()->m_Implicit )
|
||||
|
|
Loading…
Reference in New Issue