Fix for overwriting non-specified constraints.

Fixes https://gitlab.com/kicad/code/kicad/issues/14070
This commit is contained in:
Jeff Young 2023-02-28 18:09:32 +00:00
parent 764ddd4773
commit 8a34f91172
1 changed files with 18 additions and 1 deletions

View File

@ -1217,7 +1217,24 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
} }
} }
constraint = c->constraint; if( c->constraint.m_Value.HasMin() )
constraint.m_Value.SetMin( c->constraint.m_Value.Min() );
if( c->constraint.m_Value.HasOpt() )
constraint.m_Value.SetOpt( c->constraint.m_Value.Opt() );
if( c->constraint.m_Value.HasMax() )
constraint .m_Value.SetMax( c->constraint.m_Value.Max() );
// While the expectation would be to OR the disallow flags, we've already
// masked them down to aItem's type -- so we're really only looking for a
// boolean here.
constraint.m_DisallowFlags = c->constraint.m_DisallowFlags;
constraint.m_ZoneConnection = c->constraint.m_ZoneConnection;
constraint.SetParentRule( c->constraint.GetParentRule() );
return true; return true;
} }
else else