From aa6a5ab6715addeeb9cd995466bf8a721ccd0422 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 16 Jul 2013 15:45:21 +0200 Subject: [PATCH] Moved bottom netnames layer over bottom tracks & pads. Changed int to LAYER_NUM where applicable. --- include/layers_id_colors_and_visibility.h | 4 ++-- pcbnew/basepcbframe.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/layers_id_colors_and_visibility.h b/include/layers_id_colors_and_visibility.h index 270a3a870f..f22eac8dd5 100644 --- a/include/layers_id_colors_and_visibility.h +++ b/include/layers_id_colors_and_visibility.h @@ -254,7 +254,7 @@ enum PCB_VISIBLE /// Rendering order of layers on GAL-based canvas (lower index in the array /// means that layer is displayed closer to the user, ie. on the top). -const int GalLayerOrder[] = +const LAYER_NUM GalLayerOrder[] = { DRAW_N, COMMENT_N, ECO1_N, ECO2_N, EDGE_N, UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31, @@ -282,8 +282,8 @@ const int GalLayerOrder[] = ITEM_GAL_LAYER( LAYER_4_NETNAMES_VISIBLE ), LAYER_N_4, ITEM_GAL_LAYER( LAYER_3_NETNAMES_VISIBLE ), LAYER_N_3, ITEM_GAL_LAYER( LAYER_2_NETNAMES_VISIBLE ), LAYER_N_2, - ITEM_GAL_LAYER( LAYER_1_NETNAMES_VISIBLE ), LAYER_N_BACK, ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ), + ITEM_GAL_LAYER( LAYER_1_NETNAMES_VISIBLE ), LAYER_N_BACK, SOLDERMASK_N_BACK, ADHESIVE_N_BACK, SOLDERPASTE_N_BACK, SILKSCREEN_N_BACK, ITEM_GAL_LAYER( MOD_TEXT_BK_VISIBLE ) diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 229030de37..59949e8746 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -196,8 +196,10 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard ) } // Set rendering order of layers - for( unsigned int i = 0; i < sizeof( GalLayerOrder ) / sizeof( int ); ++i ) + for( LAYER_NUM i = 0; i < sizeof(GalLayerOrder) / sizeof(LAYER_NUM); ++i ) { + wxASSERT( i < KiGfx::VIEW::VIEW_MAX_LAYERS ); + view->SetLayerOrder( GalLayerOrder[i], i ); } @@ -205,16 +207,16 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard ) // so there is no point in caching them for( LAYER_NUM layer = FIRST_NETNAME_LAYER; layer <= LAST_NETNAME_LAYER; ++layer ) { - view->SetLayerCached( layer, false ); + view->SetLayerCached( layer, false ); } // Load layer & elements visibility settings - for( unsigned int i = 0; i < NB_LAYERS; ++i ) + for( LAYER_NUM i = 0; i < NB_LAYERS; ++i ) { view->SetLayerVisible( i, m_Pcb->IsLayerVisible( i ) ); } - for( unsigned int i = 0; i < END_PCB_VISIBLE_LIST; ++i ) + for( LAYER_NUM i = 0; i < END_PCB_VISIBLE_LIST; ++i ) { view->SetLayerVisible( ITEM_GAL_LAYER( i ), m_Pcb->IsElementVisible( i ) ); }