Allow mouse drag to initiate a router drag if over a track or via.

Fixes: lp:1840694
* https://bugs.launchpad.net/kicad/+bug/1840694
This commit is contained in:
Jeff Young 2019-08-19 21:09:17 +01:00
parent 195fbbaf23
commit 1bfefc61ea
4 changed files with 10 additions and 3 deletions

View File

@ -323,7 +323,8 @@ int EDIT_TOOL::Move( const TOOL_EVENT& aEvent )
grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); grid.SetUseGrid( !evt->Modifier( MD_ALT ) );
controls->SetSnapping( !evt->Modifier( MD_ALT ) ); controls->SetSnapping( !evt->Modifier( MD_ALT ) );
if( evt->IsAction( &PCB_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) || if( evt->IsAction( &PCB_ACTIONS::move ) || evt->IsMotion() ||
evt->IsAction( &PCB_ACTIONS::drag ) || evt->IsDrag( BUT_LEFT ) ||
evt->IsAction( &ACTIONS::refreshPreview ) ) evt->IsAction( &ACTIONS::refreshPreview ) )
{ {
if( m_dragging && evt->Category() == TC_MOUSE ) if( m_dragging && evt->Category() == TC_MOUSE )
@ -1413,6 +1414,7 @@ void EDIT_TOOL::setTransitions()
{ {
Go( &EDIT_TOOL::GetAndPlace, PCB_ACTIONS::getAndPlace.MakeEvent() ); Go( &EDIT_TOOL::GetAndPlace, PCB_ACTIONS::getAndPlace.MakeEvent() );
Go( &EDIT_TOOL::Move, PCB_ACTIONS::move.MakeEvent() ); Go( &EDIT_TOOL::Move, PCB_ACTIONS::move.MakeEvent() );
Go( &EDIT_TOOL::Move, PCB_ACTIONS::drag.MakeEvent() );
Go( &EDIT_TOOL::Drag, PCB_ACTIONS::drag45Degree.MakeEvent() ); Go( &EDIT_TOOL::Drag, PCB_ACTIONS::drag45Degree.MakeEvent() );
Go( &EDIT_TOOL::Drag, PCB_ACTIONS::dragFreeAngle.MakeEvent() ); Go( &EDIT_TOOL::Drag, PCB_ACTIONS::dragFreeAngle.MakeEvent() );
Go( &EDIT_TOOL::Rotate, PCB_ACTIONS::rotateCw.MakeEvent() ); Go( &EDIT_TOOL::Rotate, PCB_ACTIONS::rotateCw.MakeEvent() );

View File

@ -192,6 +192,10 @@ TOOL_ACTION PCB_ACTIONS::move( "pcbnew.InteractiveMove.move",
_( "Move" ), _( "Moves the selected item(s)" ), _( "Move" ), _( "Moves the selected item(s)" ),
move_xpm, AF_ACTIVATE ); move_xpm, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::drag( "pcbnew.InteractiveMove.drag",
AS_GLOBAL, 0, "", "", "",
move_xpm, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::duplicateIncrement( "pcbnew.InteractiveEdit.duplicateIncrementPads", TOOL_ACTION PCB_ACTIONS::duplicateIncrement( "pcbnew.InteractiveEdit.duplicateIncrementPads",
AS_GLOBAL, AS_GLOBAL,
MD_SHIFT + MD_CTRL + 'D', LEGACY_HK_NAME( "Duplicate Item and Increment" ), MD_SHIFT + MD_CTRL + 'D', LEGACY_HK_NAME( "Duplicate Item and Increment" ),

View File

@ -104,8 +104,9 @@ public:
/// Filters the items in the current selection (invokes dialog) /// Filters the items in the current selection (invokes dialog)
static TOOL_ACTION filterSelection; static TOOL_ACTION filterSelection;
/// move an item /// move or drag an item
static TOOL_ACTION move; static TOOL_ACTION move;
static TOOL_ACTION drag;
/// Rotation of selected objects /// Rotation of selected objects
static TOOL_ACTION rotateCw; static TOOL_ACTION rotateCw;

View File

@ -251,7 +251,7 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( selectionContains( evt->Position() ) ) if( selectionContains( evt->Position() ) )
{ {
// Yes -> run the move tool and wait till it finishes // Yes -> run the move tool and wait till it finishes
m_toolMgr->RunAction( PCB_ACTIONS::move, true ); m_toolMgr->RunAction( PCB_ACTIONS::drag, true );
} }
else else
{ {