router: fix shortcut crash & inline dragging for inline dragging P&S

This commit is contained in:
Tomasz Wlostowski
2015-07-02 16:10:07 +02:00
committed by Maciej Suminski
parent 2fd493255d
commit 0ade919a98
6 changed files with 22 additions and 5 deletions
+8 -3
View File
@@ -49,6 +49,8 @@
#include "edit_tool.h"
#include "grid_helper.h"
#include <router/router_tool.h>
#include <dialogs/dialog_create_array.h>
#include <dialogs/dialog_move_exact.h>
@@ -105,11 +107,14 @@ bool EDIT_TOOL::invokeInlineRouter()
TRACK* track = uniqueSelected<TRACK>();
VIA* via = uniqueSelected<VIA>();
if ( !GetSettings().Get("DragInvokesRouter", false ) )
return false;
if( track || via )
{
ROUTER_TOOL *theRouter = static_cast<ROUTER_TOOL*> ( m_toolMgr->FindTool( "pcbnew.InteractiveRouter" ) );
assert ( theRouter );
if( !theRouter->PNSSettings().InlineDragEnabled() )
return false;
m_toolMgr->RunAction( COMMON_ACTIONS::routerInlineDrag, true, track ? track : via );
return true;
}