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:
Jeff Young 2021-08-21 16:35:08 +01:00
parent 048e13f423
commit 3e57700b21
1 changed files with 2 additions and 17 deletions

View File

@ -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 )