From 76685ae2d9e3b7e6549ade6743f9372a5740e41b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 26 Mar 2023 20:41:30 +0100 Subject: [PATCH] Run SILK_CLEARANCE rules on mask layer when testing silk-to-mask clearance. This allows custom rules to be authored without firing the auto-generated rule from Board Setup > Silk Item Clearance (which should be only for silk- to-silk clearances). Fixes https://gitlab.com/kicad/code/kicad/issues/14417 (cherry picked from commit 0266d03f7963f16c6405d5c3b701c4eafe9c154a) --- pcbnew/drc/drc_test_provider_solder_mask.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_solder_mask.cpp b/pcbnew/drc/drc_test_provider_solder_mask.cpp index 7b6f14d39a..6dc3a9af2e 100644 --- a/pcbnew/drc/drc_test_provider_solder_mask.cpp +++ b/pcbnew/drc/drc_test_provider_solder_mask.cpp @@ -293,12 +293,12 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance() PCB_LAYER_ID maskLayer = layer == F_SilkS ? F_Mask : B_Mask; BOX2I itemBBox = item->GetBoundingBox(); DRC_CONSTRAINT constraint = m_drcEngine->EvalRules( SILK_CLEARANCE_CONSTRAINT, - item, nullptr, layer ); + item, nullptr, maskLayer ); int clearance = constraint.GetValue().Min(); int actual; VECTOR2I pos; - if( constraint.GetSeverity() == RPT_SEVERITY_IGNORE || clearance <= 0 ) + if( constraint.GetSeverity() == RPT_SEVERITY_IGNORE || clearance < 0 ) return true; std::shared_ptr itemShape = item->GetEffectiveShape( layer );