Browse Source

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.
7.0
Tomasz Wlostowski 3 years ago
parent
commit
0bd7f603a3
  1. 8
      pcbnew/router/pns_tool_base.cpp
  2. 2
      pcbnew/router/router_tool.cpp

8
pcbnew/router/pns_tool_base.cpp

@ -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 ) )

2
pcbnew/router/router_tool.cpp

@ -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…
Cancel
Save