Implemented flip for tuning patterns.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user