router: consider mouse drag event a valid route start/end event
L-clicks during routing operation while the mouse is moving (even slightly) were ignored, which was annoying to some users (myself included). Now the router always fixes the track upon mouse click.
This commit is contained in:
parent
eaee610fd9
commit
0bd7f603a3
|
@ -310,7 +310,13 @@ void TOOL_BASE::updateEndItem( const TOOL_EVENT& aEvent )
|
|||
m_gridHelper->SetSnap( !aEvent.Modifier( MD_SHIFT ) );
|
||||
|
||||
controls()->ForceCursorPosition( false );
|
||||
VECTOR2I mousePos = controls()->GetMousePosition();
|
||||
|
||||
VECTOR2I mousePos;
|
||||
|
||||
if( ! aEvent.IsDrag() )
|
||||
mousePos = controls()->GetMousePosition();
|
||||
else
|
||||
mousePos = aEvent.DragOrigin();
|
||||
|
||||
if( m_router->Settings().Mode() != RM_MarkObstacles &&
|
||||
( m_router->GetCurrentNets().empty() || m_router->GetCurrentNets().front() < 0 ) )
|
||||
|
|
|
@ -1186,7 +1186,7 @@ void ROUTER_TOOL::performRouting()
|
|||
updateEndItem( *evt );
|
||||
m_router->Move( m_endSnapPoint, m_endItem );
|
||||
}
|
||||
else if( evt->IsClick( BUT_LEFT ) || evt->IsAction( &PCB_ACTIONS::routeSingleTrack ) )
|
||||
else if( evt->IsClick( BUT_LEFT ) || evt->IsDrag( BUT_LEFT ) || evt->IsAction( &PCB_ACTIONS::routeSingleTrack ) )
|
||||
{
|
||||
updateEndItem( *evt );
|
||||
bool needLayerSwitch = m_router->IsPlacingVia();
|
||||
|
|
Loading…
Reference in New Issue