From 1fdaa1083ee3a920e5d396251d5e47c1078212d8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 6 Oct 2023 21:55:47 +0100 Subject: [PATCH] Honour custom layer names for Layer_Top and Layer_Bottom. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15835 (cherry picked from commit da5f5536c897aa98d20aa2f6c21a9dbc3cdaa77e) --- pcbnew/pcb_expr_evaluator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index 490be93dd7..48e5628a3b 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -129,7 +129,9 @@ LIBEVAL::VALUE* PCB_EXPR_VAR_REF::GetValue( LIBEVAL::CONTEXT* aCtx ) const wxAny& any = item->Get( it->second ); PCB_LAYER_ID layer; - if( it->second->Name() == wxT( "Layer" ) ) + if( it->second->Name() == wxT( "Layer" ) + || it->second->Name() == wxT( "Layer Top" ) + || it->second->Name() == wxT( "Layer Bottom" ) ) { if( any.GetAs( &layer ) ) return new PCB_LAYER_VALUE( layer );