diff --git a/pcbnew/generators/pcb_tuning_pattern.cpp b/pcbnew/generators/pcb_tuning_pattern.cpp index 8c650b8921..fdffca8c11 100644 --- a/pcbnew/generators/pcb_tuning_pattern.cpp +++ b/pcbnew/generators/pcb_tuning_pattern.cpp @@ -129,7 +129,23 @@ public: m_end += aMoveVector; } - const BOX2I GetBoundingBox() const override { return getRectShape().BBox(); } + void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override + { + RotatePoint( m_origin, aRotCentre, aAngle ); + RotatePoint( m_end, aRotCentre, aAngle ); + PCB_GROUP::Rotate( aRotCentre, aAngle ); + + if( m_baseLine ) + m_baseLine->Rotate( aAngle, aRotCentre ); + + if( m_baseLineCoupled ) + m_baseLineCoupled->Rotate( aAngle, aRotCentre ); + } + + const BOX2I GetBoundingBox() const override + { + return getRectShape().BBox(); + } void ViewGetLayers( int aLayers[], int& aCount ) const override { diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 6e25dbe921..46c173b126 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1756,12 +1756,13 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) commit->Modify( item ); // If rotating a group, record position of all the descendants for undo - if( item->Type() == PCB_GROUP_T ) + if( item->Type() == PCB_GROUP_T || item->Type() == PCB_GENERATOR_T ) { - static_cast( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) - { - commit->Modify( bItem ); - }); + static_cast( item )->RunOnDescendants( + [&]( BOARD_ITEM* bItem ) + { + commit->Modify( bItem ); + }); } } @@ -2042,7 +2043,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) { commit->Modify( boardItem ); - if( boardItem->Type() == PCB_GROUP_T ) + if( boardItem->Type() == PCB_GROUP_T || boardItem->Type() == PCB_GENERATOR_T ) { static_cast( boardItem )->RunOnDescendants( [&]( BOARD_ITEM* descendant ) @@ -2387,7 +2388,7 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent ) { commit.Modify( boardItem ); - if( boardItem->Type() == PCB_GROUP_T ) + if( boardItem->Type() == PCB_GROUP_T || boardItem->Type() == PCB_GENERATOR_T ) { PCB_GROUP* group = static_cast( boardItem );