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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user