Allow generator actions to affect children

Changing the generator will often modify the underlying children's
properties.  We should store these data in the stack.  Also add the
ability to change layers

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21476
This commit is contained in:
Seth Hillbrand
2025-08-15 06:50:46 -07:00
parent 8bf7975440
commit 3ec380d93c
3 changed files with 15 additions and 0 deletions
+9
View File
@@ -25,6 +25,7 @@
#include <pcb_generator.h>
#include <generators_mgr.h>
#include <functional>
#include <optional>
#include <magic_enum.hpp>
@@ -358,6 +359,14 @@ public:
}
}
void SetLayer( PCB_LAYER_ID aLayer ) override
{
PCB_GENERATOR::SetLayer( aLayer );
RunOnChildren( [aLayer]( BOARD_ITEM* item ) { item->SetLayer( aLayer ); },
RECURSE_MODE::RECURSE );
}
const BOX2I GetBoundingBox() const override
{
return getOutline().BBox();