From 4b7fe5bce326d622cfcf34da08e04bb72ab4f748 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 16 Jan 2022 19:19:55 +0000 Subject: [PATCH] EDA_ANGLE cleanup. --- .../dialog_pad_basicshapes_properties.cpp | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp index cec69eb246..b5564ba787 100644 --- a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp @@ -577,22 +577,12 @@ DIALOG_PAD_PRIMITIVES_TRANSFORM::DIALOG_PAD_PRIMITIVES_TRANSFORM( wxWindow* aPar } -// A helper function in geometry transform -inline void geom_transf( VECTOR2I& aCoord, const VECTOR2I& aMove, double aScale, double aRotation ) -{ - aCoord.x = KiROUND( aCoord.x * aScale ); - aCoord.y = KiROUND( aCoord.y * aScale ); - aCoord += aMove; - RotatePoint( aCoord, aRotation ); -} - - void DIALOG_PAD_PRIMITIVES_TRANSFORM::Transform( std::vector>* aList, int aDuplicateCount ) { - wxPoint move_vect( m_vectorX.GetValue(), m_vectorY.GetValue() ); - double rotation = m_rotation.GetValue(); - double scale = DoubleValueFromString( EDA_UNITS::UNSCALED, m_scaleCtrl->GetValue() ); + VECTOR2I move_vect( m_vectorX.GetValue(), m_vectorY.GetValue() ); + EDA_ANGLE rotation = m_rotation.GetAngleValue(); + double scale = DoubleValueFromString( EDA_UNITS::UNSCALED, m_scaleCtrl->GetValue() ); // Avoid too small / too large scale, which could create issues: if( scale < 0.01 ) @@ -606,8 +596,8 @@ void DIALOG_PAD_PRIMITIVES_TRANSFORM::Transform( std::vectorMove( currMoveVect ); shape->Scale( scale ); - shape->Rotate( VECTOR2I( 0, 0 ), EDA_ANGLE( curr_rotation, TENTHS_OF_A_DEGREE_T ) ); + shape->Rotate( VECTOR2I( 0, 0 ), curr_rotation ); } // Prepare new transform on duplication: