Select next/prev copper layer whether we start on copper or not.

Fixes https://gitlab.com/kicad/code/kicad/issues/11600
This commit is contained in:
Jeff Young 2022-05-20 12:55:58 +01:00
parent a09bd4ae12
commit f7fcc310f8
1 changed files with 0 additions and 7 deletions

View File

@ -356,9 +356,6 @@ int PCB_CONTROL::LayerNext( const TOOL_EVENT& aEvent )
int layer = editFrame->GetActiveLayer();
int startLayer = layer;
if( layer < F_Cu || layer > B_Cu )
return 0;
while( startLayer != ++layer )
{
if( brd->IsLayerVisible( static_cast<PCB_LAYER_ID>( layer ) ) && IsCopperLayer( layer ) )
@ -382,9 +379,6 @@ int PCB_CONTROL::LayerPrev( const TOOL_EVENT& aEvent )
int layer = editFrame->GetActiveLayer();
int startLayer = layer;
if( layer < F_Cu || layer > B_Cu )
return 0;
while( startLayer != --layer )
{
if( IsCopperLayer( layer ) // also test for valid layer id (layer >= F_Cu)
@ -397,7 +391,6 @@ int PCB_CONTROL::LayerPrev( const TOOL_EVENT& aEvent )
layer = B_Cu + 1;
}
wxCHECK( IsCopperLayer( layer ), 0 );
editFrame->SwitchLayer( ToLAYER_ID( layer ) );