Implemented flip for tuning patterns.

This commit is contained in:
Sven Pauli
2024-06-02 09:49:41 +00:00
committed by Jeff Young
parent 4a01f322ff
commit c7ad5efbed
3 changed files with 46 additions and 6 deletions
+22 -6
View File
@@ -35,6 +35,7 @@
#include <dialogs/dialog_unit_entry.h>
#include <collectors.h>
#include <scoped_set_reset.h>
#include <core/mirror.h>
#include <board_design_settings.h>
#include <drc/drc_engine.h>
@@ -289,12 +290,10 @@ public:
void Move( const VECTOR2I& aMoveVector ) override
{
m_origin += aMoveVector;
m_end += aMoveVector;
if( !this->HasFlag( IN_EDIT ) )
{
PCB_GROUP::Move( aMoveVector );
PCB_GENERATOR::Move( aMoveVector );
m_end += aMoveVector;
if( m_baseLine )
m_baseLine->Move( aMoveVector );
@@ -308,9 +307,8 @@ public:
{
if( !this->HasFlag( IN_EDIT ) )
{
RotatePoint( m_origin, aRotCentre, aAngle );
PCB_GENERATOR::Rotate( aRotCentre, aAngle );
RotatePoint( m_end, aRotCentre, aAngle );
PCB_GROUP::Rotate( aRotCentre, aAngle );
if( m_baseLine )
m_baseLine->Rotate( aAngle, aRotCentre );
@@ -320,6 +318,24 @@ public:
}
}
void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override
{
if( !this->HasFlag( IN_EDIT ) )
{
PCB_GENERATOR::Flip( aCentre, aFlipLeftRight );
if( aFlipLeftRight )
MIRROR( m_end.x, aCentre.x );
else
MIRROR( m_end.y, aCentre.y );
if( m_baseLine )
m_baseLine->Mirror( aFlipLeftRight, !aFlipLeftRight, aCentre );
if( m_baseLineCoupled )
m_baseLineCoupled->Mirror( aFlipLeftRight, !aFlipLeftRight, aCentre );
}
}
const BOX2I GetBoundingBox() const override
{
return getOutline().BBox();