diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 4488598fd1..d7abf9ec1e 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -832,8 +832,23 @@ void MODULE::ViewUpdate( int aUpdateFlags ) void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const { - aCount = 1; + aCount = 2; aLayers[0] = ITEM_GAL_LAYER( ANCHOR_VISIBLE ); + + switch( m_Layer ) + { + case F_Cu: + aLayers[1] = ITEM_GAL_LAYER( MOD_FR_VISIBLE ); + break; + + case B_Cu: + aLayers[1] = ITEM_GAL_LAYER( MOD_BK_VISIBLE ); + break; + + default: + assert( false ); // do you really have modules placed on inner layers? + break; + } } diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index 8d2e89f275..5f00e298ab 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -269,11 +269,13 @@ void PCB_DRAW_PANEL_GAL::SetHighContrastLayer( LAYER_ID aLayer ) if( aLayer == B_Cu ) { rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); + rSettings->SetActiveLayer( ITEM_GAL_LAYER( MOD_BK_VISIBLE ) ); rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ) ); } else if( aLayer == F_Cu ) { rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); + rSettings->SetActiveLayer( ITEM_GAL_LAYER( MOD_FR_VISIBLE ) ); rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ) ); } } diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 4c6ad9eff5..68afe3b1b3 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -588,13 +588,13 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const int layers[KIGFX::VIEW::VIEW_MAX_LAYERS], layers_count; // Filter out items that do not belong to active layers - std::set activeLayers = getView()->GetPainter()-> - GetSettings()->GetActiveLayers(); + const std::set& activeLayers = getView()->GetPainter()-> + GetSettings()->GetActiveLayers(); aItem->ViewGetLayers( layers, layers_count ); for( int i = 0; i < layers_count; ++i ) { - if( activeLayers.count( layers[i] ) > 0 ) // Item is on at least one of active layers + if( activeLayers.count( layers[i] ) > 0 ) // Item is on at least one of the active layers { onActive = true; break;