From 238c21ed0be727b0e614d5d7d0119de19b9edea7 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Mon, 29 Aug 2022 23:13:30 +0200 Subject: [PATCH] Properties: Special case PCB_SHAPE "Layer" property Fixes https://gitlab.com/kicad/code/kicad/-/issues/12304 --- pcbnew/pcb_shape.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pcbnew/pcb_shape.cpp b/pcbnew/pcb_shape.cpp index 38eac89495..d9d9f6496d 100644 --- a/pcbnew/pcb_shape.cpp +++ b/pcbnew/pcb_shape.cpp @@ -320,5 +320,10 @@ static struct PCB_SHAPE_DESC propMgr.AddTypeCast( new TYPE_CAST ); propMgr.InheritsAfter( TYPE_HASH( PCB_SHAPE ), TYPE_HASH( BOARD_ITEM ) ); propMgr.InheritsAfter( TYPE_HASH( PCB_SHAPE ), TYPE_HASH( EDA_SHAPE ) ); + + auto layerProperty = new PROPERTY_ENUM( + _HKI( "Layer" ), &PCB_SHAPE::SetLayer, &PCB_SHAPE::GetLayer ); + + propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ), layerProperty ); } } _PCB_SHAPE_DESC;