From 20efeef5ae234bebba0e7790e8b840c4c183546c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 6 Mar 2024 13:48:48 +0000 Subject: [PATCH] Apply anti-walk algorithm only to textboxes. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16481 --- pcbnew/tools/edit_tool.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index a4fb0105ab..f529a54a5d 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1791,10 +1791,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( selection.Front() ) ) { - if( BOARD_ITEM* item = dynamic_cast( selection.Front() ) ) - selection.SetReferencePoint( item->GetCenter() ); + selection.SetReferencePoint( static_cast( selection.Front() )->GetCenter() ); } else {