From 9627f063ff59a04eff79160ebb324c09ff6c7914 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 30 Jan 2017 14:05:26 +0100 Subject: [PATCH] Added missing handler for 'activate' events in EDIT_TOOL Fixes: lp:1660306 * https://bugs.launchpad.net/kicad/+bug/1660306 --- pcbnew/tools/edit_tool.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 36dd9e648e..4847fc57e1 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -171,19 +171,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) // Main loop: keep receiving events do { - if( evt->IsCancel() ) - { - restore = true; // Cancelling the tool means that items have to be restored - break; // Finish - } - - else if( evt->Action() == TA_UNDO_REDO_PRE ) - { - unselect = true; - break; - } - - else if( evt->IsAction( &COMMON_ACTIONS::editActivate ) + if( evt->IsAction( &COMMON_ACTIONS::editActivate ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) { BOARD_ITEM* curr_item = selection.Front(); @@ -253,6 +241,18 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true ); } + else if( evt->IsCancel() || evt->IsActivate() ) + { + restore = true; // Cancelling the tool means that items have to be restored + break; // Finish + } + + else if( evt->Action() == TA_UNDO_REDO_PRE ) + { + unselect = true; + break; + } + // Dispatch TOOL_ACTIONs else if( evt->Category() == TC_COMMAND ) {