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

Fixes: lp:1840694
* https://bugs.launchpad.net/kicad/+bug/1840694

(cherry picked from commit 1bfefc61ea)
This commit is contained in:
Jeff Young 2019-08-19 21:09:17 +01:00
parent ebba15fe67
commit de22204514
4 changed files with 12 additions and 5 deletions

View File

@ -87,6 +87,9 @@ TOOL_ACTION PCB_ACTIONS::move( "pcbnew.InteractiveEdit.move",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MOVE_ITEM ), AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MOVE_ITEM ),
_( "Move" ), _( "Moves the selected item(s)" ), move_xpm, AF_ACTIVATE ); _( "Move" ), _( "Moves the selected item(s)" ), move_xpm, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::drag( "pcbnew.InteractiveMove.drag",
AS_GLOBAL, 0, "", "", move_xpm, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::duplicate( "pcbnew.InteractiveEdit.duplicate", TOOL_ACTION PCB_ACTIONS::duplicate( "pcbnew.InteractiveEdit.duplicate",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DUPLICATE_ITEM ), AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DUPLICATE_ITEM ),
_( "Duplicate" ), _( "Duplicates the selected item(s)" ), duplicate_xpm ); _( "Duplicate" ), _( "Duplicates the selected item(s)" ), duplicate_xpm );
@ -416,9 +419,8 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
controls->SetSnapping( !evt->Modifier( MD_ALT ) ); controls->SetSnapping( !evt->Modifier( MD_ALT ) );
if( evt->IsAction( &PCB_ACTIONS::editActivate ) || if( evt->IsAction( &PCB_ACTIONS::editActivate ) ||
evt->IsAction( &PCB_ACTIONS::move ) || evt->IsAction( &PCB_ACTIONS::move ) || evt->IsMotion() ||
evt->IsMotion() || evt->IsAction( &PCB_ACTIONS::drag ) || evt->IsDrag( BUT_LEFT ) ||
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 )
@ -1411,6 +1413,7 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
void EDIT_TOOL::setTransitions() void EDIT_TOOL::setTransitions()
{ {
Go( &EDIT_TOOL::Main, PCB_ACTIONS::move.MakeEvent() ); Go( &EDIT_TOOL::Main, PCB_ACTIONS::move.MakeEvent() );
Go( &EDIT_TOOL::Main, 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

@ -92,8 +92,9 @@ public:
/// Activation of the edit tool /// Activation of the edit tool
static TOOL_ACTION editActivate; static TOOL_ACTION editActivate;
/// move an item /// move or drag an item
static TOOL_ACTION move; static TOOL_ACTION move;
static TOOL_ACTION drag;
/// Rotation of selected objects clockwise /// Rotation of selected objects clockwise
static TOOL_ACTION rotateCw; static TOOL_ACTION rotateCw;

View File

@ -349,7 +349,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
{ {

View File

@ -197,6 +197,9 @@ TOOL_ACTION PCB_ACTIONS::move( "pcbnew.InteractiveEdit.move",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MOVE_ITEM ), AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_MOVE_ITEM ),
_( "Move" ), _( "Moves the selected item(s)" ), nullptr, AF_ACTIVATE ); _( "Move" ), _( "Moves the selected item(s)" ), nullptr, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::drag( "pcbnew.InteractiveMove.drag",
AS_GLOBAL, 0, "", "", nullptr, AF_ACTIVATE );
// Initialize static member variables // Initialize static member variables
wxString DIALOG_FIND::prevSearchString; wxString DIALOG_FIND::prevSearchString;