Honour custom layer names for Layer_Top and Layer_Bottom.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15835

(cherry picked from commit da5f5536c8)
This commit is contained in:
Jeff Young 2023-10-06 21:55:47 +01:00
parent 2f8e846b9e
commit 1fdaa1083e
1 changed files with 3 additions and 1 deletions

View File

@ -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<PCB_LAYER_ID>( &layer ) )
return new PCB_LAYER_VALUE( layer );