From b6ff44cccfd7ccba652d8bb684cc7056d10475ed Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 21 Dec 2021 16:03:36 +0000 Subject: [PATCH] Fix failure to remove hover selection after rotate operation. Fixes https://gitlab.com/kicad/code/kicad/issues/10058 (cherry picked from commit f696c4ddfc7d285451c708375cbc39b03fbba1b0) --- pcbnew/tools/edit_tool.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index fd77cd5ab6..436ebfd575 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1429,6 +1429,8 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) return 0; OPT oldRefPt = boost::make_optional( false, VECTOR2I( 0, 0 ) ); + bool is_hover = selection.IsHover(); // N.B. This must be saved before the second + // call to RequestSelection() below if( selection.HasReferencePoint() ) oldRefPt = selection.GetReferencePoint(); @@ -1479,7 +1481,7 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) if( !m_dragging ) m_commit->Push( _( "Rotate" ) ); - if( selection.IsHover() && !m_dragging ) + if( is_hover && !m_dragging ) m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );