Fix a minor issue in Legacy mode: DCodes were displayed regardless the visibility of the layers.

This commit is contained in:
jean-pierre charras 2018-11-24 10:14:33 +01:00
parent 0b890b4d1d
commit 0e705cd338
1 changed files with 2 additions and 1 deletions

View File

@ -355,6 +355,7 @@ void GBR_LAYOUT::DrawItemsDCodeID( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
wxString Line;
GRSetDrawMode( aDC, aDrawMode );
GERBVIEW_FRAME* gerbFrame = static_cast<GERBVIEW_FRAME*>( aPanel->GetParent() );
for( unsigned layer = 0; layer < GetImagesList()->ImagesMaxCount(); ++layer )
{
@ -363,7 +364,7 @@ void GBR_LAYOUT::DrawItemsDCodeID( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
if( gerber == NULL ) // Graphic layer not yet used
continue;
if( ! gerber->m_IsVisible )
if( !gerbFrame->IsLayerVisible( layer ) )
continue;
for( GERBER_DRAW_ITEM* item = gerber->GetItemsList(); item != NULL; item = item->Next() )