From 8a34f9117291aff0c0b3b05e53681d021f1f0e63 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 28 Feb 2023 18:09:32 +0000 Subject: [PATCH] Fix for overwriting non-specified constraints. Fixes https://gitlab.com/kicad/code/kicad/issues/14070 --- pcbnew/drc/drc_engine.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index 50d64865fc..f938ca1635 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -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; } else