Apply anti-walk algorithm only to textboxes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16481

(cherry picked from commit 20efeef5ae)
This commit is contained in:
Jeff Young 2024-03-06 13:48:48 +00:00
parent 8a66a7eab0
commit b57184efe0
1 changed files with 4 additions and 3 deletions

View File

@ -1766,10 +1766,11 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
if( selection.Empty() )
return 0;
if( selection.Size() == 1 )
// 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() ) )
{
if( BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( selection.Front() ) )
selection.SetReferencePoint( item->GetCenter() );
selection.SetReferencePoint( static_cast<PCB_TEXTBOX*>( selection.Front() )->GetCenter() );
}
else
{