From 51c20da93e52f12973fd93b81f9600ea3d977238 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 7 Oct 2022 23:48:53 +0100 Subject: [PATCH] Areas might have layers defined in area as well as rule. Fixes https://gitlab.com/kicad/code/kicad/issues/12584 --- pcbnew/pcb_expr_evaluator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index 889d0071c1..963617e5e7 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -629,6 +629,9 @@ static void intersectsAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self ) if( !aArea || aArea == item || aArea->GetParent() == item ) return false; + if( !( aArea->GetLayerSet() & item->GetLayerSet() ).any() ) + return false; + if( !aArea->GetBoundingBox().Intersects( itemBBox ) ) return false; @@ -692,6 +695,9 @@ static void enclosedByAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self ) if( !aArea || aArea == item || aArea->GetParent() == item ) return false; + if( !( aArea->GetLayerSet() & item->GetLayerSet() ).any() ) + return false; + if( !aArea->GetBoundingBox().Intersects( itemBBox ) ) return false;