From 2f392352b5fca0770575b0c30a328730dd4d03c8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 26 Apr 2023 12:40:44 +0200 Subject: [PATCH] EDIT_TOOL::doMoveSelection(): avoid calling PushTool() and, just after,PopTool() for the *same* event: TOOLS_HOLDER::PopTool() does not work fine in this case. --- pcbnew/tools/edit_tool_move_fct.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index f51eb92b59..c8b0e953c2 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -283,8 +283,6 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi wxString status; size_t itemIdx = 0; - editFrame->PushTool( aEvent ); - // Be sure that there is at least one item that we can modify. If nothing was selected before, // try looking for the stuff under mouse cursor (i.e. KiCad old-style hover selection) PCB_SELECTION& selection = m_selectionTool->RequestSelection( @@ -298,10 +296,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi !m_isFootprintEditor && cfg->m_AllowFreePads ); if( m_dragging || selection.Empty() ) - { - editFrame->PopTool( aEvent ); return 0; - } LSET item_layers = selection.GetSelectionLayers(); bool is_hover = selection.IsHover(); // N.B. This must be saved before the second call @@ -324,11 +319,12 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi if( selection.Empty() ) { - editFrame->PopTool( aEvent ); return 0; } + editFrame->PushTool( aEvent ); Activate(); + // Must be done after Activate() so that it gets set into the correct context controls->ShowCursor( true ); controls->SetAutoPan( true );