Respect locked flag when inline dragging.

Fixes https://gitlab.com/kicad/code/kicad/issues/6117
This commit is contained in:
Jeff Young 2020-10-30 17:40:07 +00:00
parent 75e46a0037
commit 203c8df909
2 changed files with 14 additions and 7 deletions

View File

@ -299,6 +299,12 @@ int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent )
if( aEvent.IsAction( &PCB_ACTIONS::dragFreeAngle ) ) if( aEvent.IsAction( &PCB_ACTIONS::dragFreeAngle ) )
mode |= PNS::DM_FREE_ANGLE; mode |= PNS::DM_FREE_ANGLE;
// deal with locked items (override lock or abort the operation)
SELECTION_LOCK_FLAGS lockFlags = m_selectionTool->CheckLock();
if( lockFlags == SELECTION_LOCKED )
return 0;
invokeInlineRouter( mode ); invokeInlineRouter( mode );
return 0; return 0;
@ -467,6 +473,12 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
{ {
// Prepare to start dragging // Prepare to start dragging
// deal with locked items (override lock or abort the operation)
SELECTION_LOCK_FLAGS lockFlags = m_selectionTool->CheckLock();
if( lockFlags == SELECTION_LOCKED )
break;
if( !( evt->IsAction( &PCB_ACTIONS::move ) if( !( evt->IsAction( &PCB_ACTIONS::move )
|| evt->IsAction( &PCB_ACTIONS::moveWithReference ) ) || evt->IsAction( &PCB_ACTIONS::moveWithReference ) )
&& isInteractiveDragEnabled() ) && isInteractiveDragEnabled() )
@ -475,12 +487,6 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
break; break;
} }
// deal with locked items (override lock or abort the operation)
SELECTION_LOCK_FLAGS lockFlags = m_selectionTool->CheckLock();
if( lockFlags == SELECTION_LOCKED )
break;
m_dragging = true; m_dragging = true;
// When editing footprints, all items have the same parent // When editing footprints, all items have the same parent

View File

@ -27,6 +27,7 @@
#include <limits> #include <limits>
#include <functional> #include <functional>
using namespace std::placeholders; using namespace std::placeholders;
#include <core/kicad_algo.h>
#include <class_board.h> #include <class_board.h>
#include <class_board_item.h> #include <class_board_item.h>
#include <class_track.h> #include <class_track.h>
@ -45,7 +46,7 @@ using namespace std::placeholders;
#include <pcbnew_settings.h> #include <pcbnew_settings.h>
#include <tool/tool_event.h> #include <tool/tool_event.h>
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
#include <router/router_tool.h> //#include <router/router_tool.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
#include <footprint_viewer_frame.h> #include <footprint_viewer_frame.h>
#include <id.h> #include <id.h>