Gerber viewer: don't go to next layer if on last layer

This commit is contained in:
Mike Williams 2022-07-25 12:59:28 -04:00
parent 4a6ac8ca2f
commit 1460442a80
1 changed files with 1 additions and 1 deletions

View File

@ -327,7 +327,7 @@ int GERBVIEW_CONTROL::LayerNext( const TOOL_EVENT& aEvent )
{
int layer = m_frame->GetActiveLayer();
if( layer < GERBER_DRAWLAYERS_COUNT - 1 )
if( layer < ( (int) GERBER_FILE_IMAGE_LIST::GetImagesList().GetLoadedImageCount() - 1 ) )
m_frame->SetActiveLayer( layer + 1, true );
return 0;