Pcbnew, router tool: ensure switching layer by + or - works when starting routing.

Fixes #9936
https://gitlab.com/kicad/code/kicad/issues/9936
This commit is contained in:
jean-pierre charras 2021-12-11 09:54:03 +01:00
parent d1e6c216e1
commit 6d0d4e0db9
1 changed files with 6 additions and 0 deletions

View File

@ -732,6 +732,9 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
if( aEvent.IsAction( &PCB_ACTIONS::layerNext ) )
{
if( m_lastTargetLayer == UNDEFINED_LAYER )
m_lastTargetLayer = currentLayer;
size_t idx = 0;
for( size_t i = 0; i < layers.size(); i++ )
@ -748,6 +751,9 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
}
else if( aEvent.IsAction( &PCB_ACTIONS::layerPrev ) )
{
if( m_lastTargetLayer == UNDEFINED_LAYER )
m_lastTargetLayer = currentLayer;
size_t idx = 0;
for( size_t i = 0; i < layers.size(); i++ )