7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 16:03:43 +00:00

pcbnew: table rotation: table jumps if rotation ends at 180°

This commit is contained in:
Damjan 2025-03-07 21:38:56 +01:00 committed by Jeff Young
parent 95d8634401
commit bded181ad0
3 changed files with 1 additions and 8 deletions

View File

@ -190,14 +190,9 @@ void PCB_TABLE::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
if( GetCells().empty() )
return;
bool translate = GetCell( 0, 0 )->GetTextAngle() + aAngle == ANGLE_180;
for( PCB_TABLECELL* cell : m_cells )
cell->Rotate( aRotCentre, aAngle );
if( translate )
Move( GetPosition() - GetEnd() );
Normalize();
}

View File

@ -591,7 +591,7 @@ void PCB_TEXTBOX::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
if( GetTextAngle().IsCardinal() && GetShape() != SHAPE_T::RECTANGLE )
{
std::vector<VECTOR2I> corners = GetCorners();
std::vector<VECTOR2I> corners = GetCornersInSequence();
VECTOR2I diag = corners[2] - corners[0];
EDA_ANGLE angle = GetTextAngle();

View File

@ -2004,8 +2004,6 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
if( selection.Empty() )
return 0;
// A single textbox "walks" if we rotate it around its position, as we keep resetting which
// corner is the origin.
if( selection.Size() == 1 && dynamic_cast<PCB_TEXTBOX*>( selection.Front() ) )
{
selection.SetReferencePoint( static_cast<PCB_TEXTBOX*>( selection.Front() )->GetCenter() );