From 1460442a80ae95b15e403829db4884b0a91d01cc Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 25 Jul 2022 12:59:28 -0400 Subject: [PATCH] Gerber viewer: don't go to next layer if on last layer --- gerbview/tools/gerbview_control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerbview/tools/gerbview_control.cpp b/gerbview/tools/gerbview_control.cpp index 9ef5a0912a..795e89d179 100644 --- a/gerbview/tools/gerbview_control.cpp +++ b/gerbview/tools/gerbview_control.cpp @@ -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;